> How does this technique (sndPlaySound) give you more control than just using the SET BELL command? Where can I get docs on sndPlaySound?
Chaim,
Here's the code of FOCUS.FLL that makes use of sndPlaySound(). As you mentioned, sndPlaySound() provides greater functionality than SET BELL ...
FOCUSFNC FW_SND_play( XBASE_PARAMETERS )
/*------------------------------------*/
{ /* Documented */
_initparc(1);
sprintf( LastWaveFile,">>>>%s",_parc(1) );
if ( PCOUNT() == 2 )
sndPlaySound( _parc(1),_parni(2) );
else
sndPlaySound( _parc(1),1 );
_deinitparc(1);
FOCUSFNCRETURN();
}
You can use the SND_play() of FOCUS.FLL to play a sound ... or you can use the following statements that will make a direct use to the winmm.dll :
#define ASYNCHRONOUS 1
#define SYNCHRONOUS 0
DECLARE INTEGER sndPlaySound IN winmm.dll STRING wav,INTEGER sync
? sndPlaySound( "MYWAVE.WAV",SYNCHRONOUS )
? sndPlaySound( "MYWAVE.WAV",ASYNCHRONOUS )
The advantage of the ASYNCHRONOUS mode is obvious : the program keeps on working even though the WAV file is not finished.
Pat