PlaySound function

I was looking around for a post about playing sounds with the running console, and the easiest way I found is "Playsound" function in <mmsystem.h> library. if anyone knows how to use it please post an example or if anybody knows a better way to play sounds please reply ASAP because my deadline is a week from now. thanks in advance
hi,
PlaySound is probably the easiest way to play wave files.
the link below is msdn doc and has full examples of how to use PlaySound

http://msdn.microsoft.com/en-us/library/dd743680%28v=VS.85%29.aspx
that was fast :D alright thanks a million dude i'ma check it out
alright i checked it and the program runs now but no sound is outputted, so please if anyone can post a short program example of using this function on "CodeBlocks" Windows 7 and the wave sound file is only about 180 Kb.
not experienced with code blocks but if you post your code we might be able to help.

Also just a thought, You need to have the wav file in the same directory as your exe
unless you provide a full/relative path in your code.

hope this helps.

yeah i have it in the same directory, the program i'm working on is a Pacman game it's not finished yet and it's around 700 lines lol so it would be frustrating to read it so i might make a short program and post it with the exact details of the wave file and if you can help me then it would be great
Topic archived. No new replies allowed.