Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Play a WAV
Message
 
To
10/10/2002 15:23:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00710023
Message ID:
00710084
Views:
14
You can try this...
* Play a wave file using Microsoft Multimedia Control
PROCEDURE PlayWavCtrl
   LParam pcWavfile

   Local loMMControl
   loMMControl = CreateObject('MCI.MMControl')

   loMMControl.DeviceType = 'WaveAudio'
   loMMControl.Filename = FullPath(pcWavfile)
   loMMControl.command='Open'
   loMMControl.Wait = .t.
   loMMControl.command='Play'
   loMMControl.command='Close'

   Release loMMControl
ENDPROC

* Play a wave file using the Multimedia API
PROCEDURE PlayWavAPI
    LParam pcWavfile
    Local cFPath
    
    DECLARE INTEGER mciSendString IN WINMM ;
            STRING sendstr, INTEGER retstr, INTEGER szret, INTEGER callback

    cFPath = IIF(Left(LTrim(pcWavFile),1) != '"', '"'+M.pcWavFile+'"', pcWavFile)
    mciSendString("open "+cFPath+ ;
                 " type waveaudio alias mmwav", 0, 0, 0)
    mciSendString("play mmwav wait", 0, 0, 0)
    mciSendString("close mmwav", 0, 0, 0)
ENDPROC
>INstalling Norton Anti-virus 2003 has cause my internal VFP application to stop making sound. It had been doing default windows events on msgbox() commands, so the user would hear a beep after saving a record, etc.
>
>They swear they need those beeps.
>
>what is the easiest way to play a WAV file 'manually ' in VFP???

Just an opinion... Not a fact.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform