Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Play .WAV in 5.0a
Message
From
09/07/1998 04:56:39
 
 
To
08/07/1998 13:41:59
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00115312
Message ID:
00115608
Views:
11
> 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
Previous
Reply
Map
View

Click here to load this message in the networking platform