Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control over playing of WAV files
Message
From
18/04/2000 12:00:35
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00360633
Message ID:
00360898
Views:
9
Thanks David,

I looked it up and it does have the functionality I was looking for:
sndPlaySound
The sndPlaySound function plays a waveform sound specified either by a filename or by an entry in the registry or the WIN.INI file. This function offers a subset of the functionality of the PlaySound function; sndPlaySound is being maintained for backward compatibility.

BOOL sndPlaySound(LPCSTR lpszSound, UINT fuSound )

Parameters
lpszSound
A string that specifies the sound to play. This parameter can be either an entry in the registry or in WIN.INI that identifies a system sound, or it can be the name of a waveform-audio file. (If the function does not find the entry, the parameter is treated as a filename.) If this parameter is NULL, any currently playing sound is stopped.
fuSound
Flags for playing the sound. The following values are defined:
SND_ASYNC
The sound is played asynchronously and the function returns immediately after beginning the sound. To terminate an asynchronously played sound, call sndPlaySound with lpszSoundName set to NULL.
SND_LOOP
The sound plays repeatedly until sndPlaySound is called again with the lpszSoundName parameter set to NULL. You must also specify the SND_ASYNC flag to loop sounds.
SND_MEMORY
The parameter specified by lpszSoundName points to an image of a waveform sound in memory.
SND_NODEFAULT
If the sound cannot be found, the function returns silently without playing the default sound.
SND_NOSTOP
If a sound is currently playing, the function immediately returns FALSE, without playing the requested sound.
SND_SYNC
The sound is played synchronously and the function does not return until the sound ends.
Return Values
Returns TRUE if successful or FALSE otherwise.



>Ashley,
>
>Check MSDN for sndPlaySound I haven't looked at it in a while I don't remember it it can tell you if a sound is currently playing or you can interrupt one. Being able to play a sound asynchronously is definately handy though.
>
>>I'm not sure if it will allow me to terminate the playing of a WAV file or determine if it is still playing, but it will work better than the SET BELL TO in that processing can continue while it is playing.
Previous
Reply
Map
View

Click here to load this message in the networking platform