Jump to content
  • Advertisement

Archived

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

flip5577

Playing a simple .wav sound in a c++ application

This topic is 5867 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For my AP computer science class, we have to make this pacman game for our final project. I want to add sound to my game. I have a wav file that I want to play every time he eats a dot. What code and header files do i have to use to get him to play a sound? Larry Charles CEO Centra Entertainment Studios

Share this post


Link to post
Share on other sites
Advertisement
Using the Platform SDK (i.e. no DirectSound):

BOOL PlaySound(
LPCSTR pszSound,
HMODULE hmod,
DWORD fdwSound
);

Header: Declared in Mmsystem.h; include Windows.h.
Library: Use Winmm.lib.


Have a look to here for details

Forever trusting who we are
And nothing else matters
- Metallica

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!