Archived

This topic is now archived and is closed to further replies.

Rnoodles

Sound

Recommended Posts

I''ve been trying to find out how to play wav files in a program. I looked on a few programming websites, and I looked through the dsound.h file. I haven''t found any effective ways to play a wav. (one guy told me to do system("mywav.wav") Thanks! _NOOODLES

Share this post


Link to post
Share on other sites
<< I've been trying to find out how to play wav files in a program. >>

Couple of options. If you don't need to mix sounds, then you can use PlaySound() which is part of Windows. Look up the parameters for that function. Problem is once a new sound plays, the other one is cut off. So only one WAV sound at a time here. You can play WAV as a file, or as a resource (inside the EXE).

Another option is FMOD, mentioned above.

Another option is using DirectSound from DirectX 6. I use straight C style calls. My demo below which plays as a resource (you can also play WAV as a file).

DirectSound Demo C Source

DirectSound Demo EXE

You'll also need to #include

dsutil.h and dsutil.cpp

with your project.

Phil P

[edited by - PhilVaz on July 6, 2003 4:07:05 AM]

Share this post


Link to post
Share on other sites