Advertisement

Question: Sound in C++ programs

Started by April 12, 2003 04:08 PM
0 comments, last by nigirimeshi 21 years, 9 months ago
How do you make a program with sound(wav and midi) in C++? Can you give me code or a link to code to run it? Is there a library for it? Thanks. "This is sickening! You sound like chapters from a self-help booklet! Prepare yourselves!" -Kefka
"This is sickening! You sound like chapters from a self-help booklet! Prepare yourselves!" -Kefka
Ok I''m sort of new to using the Windows API and I haven''t used DirectX yet but ASSUMING you are wanting to use the Windows API you would use the PlaySound(). You would need to include mmsystem.h and link the winmm.lib

I also put the Waves in a Resource File an example of the code you would use is like this

PlaySound(MAKEINTRESOURCE(PLAY_SOUND), hinstance_app, SND_RESOURCE|SND_ASYNC);

If this looks completely foreign to you then I suggest looking up the function in google or get a book.

This topic is closed to new replies.

Advertisement