sound

Does anyone know how to play a wave file. do i have to play sound in a seperate thread so as to not disrupt the graphics pipe ?

Yes, but my response would be off topic.

Use the function PlaySound() in windows. You’ll have to pass SND_ASYNC as one of the parameters. That will cause the sound to play in the background and processing will resume. Also, I think if you pass
SND_ASYNC | SND_LOOP it will play untill you call the function again and pass SND_STOP, but I’m not sure on that one. This function is defined by #include “mmsystem.h”.

You have a few options other then the windows sound function.
There are a few cross platform sound API’s.
openAL Open Audio.
FMOD API: play wav, mp3’s, MOD,STM etc.
BASS API: Play’s wav, mp3’s
SDL API
Any will give you what you are looking for, then play the sound on a there our thread.
Most of then support 3D sound effects, direct sound support, etc.

Originally posted by Dentist:
Does anyone know how to play a wave file. do i have to play sound in a seperate thread so as to not disrupt the graphics pipe ?