im making a game, on which i want to implement .wav
sounds. but i have no idea on how to load wav files and
play them, can somebody give me an example or explain
me how to play wav sounds via C++?
Printable View
im making a game, on which i want to implement .wav
sounds. but i have no idea on how to load wav files and
play them, can somebody give me an example or explain
me how to play wav sounds via C++?
You can use BASS sound library if you wish.
I'm not sure about the licensing on BASS, although it may not matter for you project. It's rather popular though and as it's atleast somewhat commercial, I would expect the support to be pretty decent.
I would use SFML though, which uses OpenAL. SDL would be the other obvious choice for me, I'm not sure what it uses though.
Thanks Walker! my game can now play .wav sounds!
OpenAL is easy enough to use on its own so I would use it. You will also want to get freealut since this can load WAV files. It is outside of the scope of OpenAL to load various file formats so you will have to either create loaders or download third party ones in order to load sounds/music.