🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Multiplayer Game Programming Chapter 7

Started by
1 comment, last by ajh158 22 years, 12 months ago
A number of examples in this chapter use: PlaySound("join.wav",NULL,SND_FILENAME); I assume this should play a sound. On my system, it does not. I tried with both a build that I typed the code in for and a build from the code copied from the CD. I also looked for documentation of the PlaySound function call and winmm.lib on MSDn, but couldn''t find anything helpful (strangely- I have used MSDN extensively in the past and it IS usually helpful). Where is join.wav loaded from? Any ideas on why this isn''t working? Thanks! ajh158
Advertisement
The join.wav file needs to be in your execution directory. On the CD it should be under the Release folder in the project space.

Maybe you are compiling in Debug mode? If so, you need to put the join.wav file in the debug folder.

Here is the MSDN listing (courtesy of Microsoft)
  PlaySoundThe PlaySound function plays a sound specified by the given filename, resource, or system event. (A system event may be associated with a sound in the registry or in the WIN.INI file.) BOOL PlaySound(  LPCSTR pszSound,    HMODULE hmod,       DWORD fdwSound    ); RemarksThe sound specified by pszSound must fit into available physical memory and be playable by an installed waveform-audio device driver. PlaySound searches the following directories for sound files: the current directory; the Windows directory; the Windows system directory; directories listed in the PATH environment variable; and the list of directories mapped in a network. For more information about the directory search order, see the documentation for the OpenFile function.If it cannot find the specified sound, PlaySound uses the default system event sound entry instead. If the function can find neither the system default entry nor the default sound, it makes no sound and returns FALSE.QuickInfo  Windows NT: Requires version 3.1 or later.  Windows: Requires Windows 95 or later.  Windows CE: Unsupported.  Header: Declared in mmsystem.h.  Import Library: Use winmm.lib.  Unicode: Implemented as Unicode and ANSI versions on Windows NT.  

Let me know if you still have problems.

LostLogic
www.lostlogic.com
Author, Multiplayer Game Programming

LostLogicwww.GamerOutfit.comXBox 360 Community Games Reviews and NewsExisled - 2D/3D Shooter for XBox 360

I have a support section on my website. You will find updates and bug-fixes there.

Thanks!


LostLogic
www.lostlogic.com
Author, Multiplayer Game Programming

LostLogicwww.GamerOutfit.comXBox 360 Community Games Reviews and NewsExisled - 2D/3D Shooter for XBox 360

This topic is closed to new replies.

Advertisement