The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: gavin on October 25, 2005, 07:28:06 PM

Title: Invoke PlaySound not working in win2k, xp is fine
Post by: gavin on October 25, 2005, 07:28:06 PM
I moved from windows xp to win2k sp4.


Invoke PlaySound, ADDR sound, NULL, SND_FILENAME or SND_ASYNC or SND_LOOP


I've searched google before i posted and have not come up with anything.

Thanks for any help.

Gavin
Title: Re: Invoke PlaySound not working in win2k, xp is fine
Post by: PBrennick on October 26, 2005, 01:23:33 AM
OFFSET sound, perhaps?

Paul
Title: Re: Invoke PlaySound not working in win2k, xp is fine
Post by: Tedd on October 26, 2005, 11:58:49 AM
Make sure "ADDR sound" points to a valid filename, and one that will be found in the current path. Also, the wave file shouldn't be too big. And this function isn't available on earlier versions of windows


From http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_playsound.asp:
QuoteThe 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.

Windows 95/98/Me: PlaySoundW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application