Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WAV Files
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00398950
Message ID:
00399083
Views:
20
>Anyone know how to start and/or stop WAV files from within VFP?
>
>I'd also like to be able to get info from the WAV file, like
>length, current position when playing,etc.
>
>Thanks

This is the code that I use to play a WAV file.

*************************************** Play Wav
*
* Description
* Plays a wav file. Pass .T. for syncronous (program
* delays til finished) or .F. (or nothing) for asyncronous.
*
* Assumptions
* 1. The *.wav file exists in the search path or the
* full path to it has been provided.
*
* Called by
* Many
*
* Parameters
* vcWavFile
* The wav file to play.
* vlSync
* Flag to indicate whether to play the wav file syncronous or not.
*
LPARAMETERS vcWavFile, vlSync
LOCAL lcWavFile, lnFlags

lnFlags = 0
lcWavFile = LOCFILE(vcWavFile, "WAV")

DECLARE INTEGER sndPlaySound IN WINMM.DLL ;
STRING lcWavFile, ;
INTEGER lnFlags

IF vlSync
=sndPlaySound(lcWavFile, 16)
ELSE
=sndPlaySound(lcWavFile, 17)
ENDIF

Steve
Previous
Reply
Map
View

Click here to load this message in the networking platform