Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PlaySound ()....No Sound

Status
Not open for further replies.

Mtlca401

Programmer
Mar 18, 2003
42
0
0
US
I am reading this book right now, I am a beginner to C++

I am trying to get this .wav file to play with the code that was in the book, but it doesn't work. I did everything said in the book.

This is the code he has:

case WM_CREATE:
PlaySound(TEXT("HelloWin.wav"), NULL, SND_FILENAME | SND_ASYNC);
return 0;

HelloWin.wav is in the same folder as the project file. The book also said to put WINMM.LIB in the Object/Library Modules under project->settings..

Thanks
 
I really dont know, I got it to work a long time ago but wasnt satisfied(it lags the program a bit every time the sound is played) so I switched to using DirectX sound. Try this tho:

PlaySound("C:\\FullPath\\HelloWin.wav", NULL, SND_FILENAME | SND_ASYNC);

See if that works.

-Micah
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top