MrFul's picture

OpenTK audio file loading

Hi!

I am trying to make a sound loading class for my game, But when I try to use the code provided in the openTK manual, it can't find the AudioReader class.

These are the references:

using OpenTK;
using OpenTK.Audio;
using OpenTK.Audio.OpenAL;

And this is were the magic would have happen if it worked...

          AudioContext AC = new AudioContext();
          uint MyBuffer;
          AL.GenBuffers( 1, out MyBuffer );
 
          AudioReader sound = new AudioReader("test.wav");
          AL.BufferData(MyBuffer, sound.ReadToEnd());

Everything seems fine except for the AudioReader which Visual studio can't recognise.

Have I missed something important? To me it seems so, please enlighten me about this issue!


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ryandaniels's picture

Same problem. Do I have to download 1.1 to use this class?

Also, regarding 1.1, is it feasible to use 1.1 if my project it close to release? How would this effect end users?

I'm thinking of switching to 1.1 already simply because I need certain input capabilities that are not implemented yet in 1.0.

Toastgeraet's picture

I have got the same problem. :(

edit: now i tried doing it with the OpenTK.Compatibility dll, since that one has AudioReader, but I still can't get it to playback...