I've looked around, and all the example code I can find using OpenTK's audio libraries seem to reference deprecated code. If someone could point me towards a tutorial that will just play simple sounds, I'd really appreciate it.
Posted Saturday, 30 July, 2011 - 13:33 by the Fiddler
OpenAL is a low-level API that does not provide any facilities to load audio files from disk. Indeed, it doesn't even know what a "file" is.
Check out the "Playback" sample in the OpenTK Example Browser (you can find that in your start menu, if you are using windows). It loads a .wav file from disk and plays it back using OpenAL.
The DragonOgg project provides a managed loader for .ogg files (an open-source audio format with better compression than .mp3). You can use that to load .ogg files and play them back using the code from the example above (I've been using that successfully for the past year or so).
For other file formats, you will probably have to p/invoke native libraries (but if you do find managed loaders for .mp3 or other formats, please post it!)
Comments
Re: Need help with OpenAL
OpenAL is a low-level API that does not provide any facilities to load audio files from disk. Indeed, it doesn't even know what a "file" is.
Check out the "Playback" sample in the OpenTK Example Browser (you can find that in your start menu, if you are using windows). It loads a .wav file from disk and plays it back using OpenAL.
The DragonOgg project provides a managed loader for .ogg files (an open-source audio format with better compression than .mp3). You can use that to load .ogg files and play them back using the code from the example above (I've been using that successfully for the past year or so).
For other file formats, you will probably have to p/invoke native libraries (but if you do find managed loaders for .mp3 or other formats, please post it!)
Re: Need help with OpenAL
Thank you for the response! Dragon Ogg looks like it's exactly what I wanted.