Using Win32 functions in Visual FoxPro Image Gallery
Windows Multimedia
..msdn
AVIFileExit
AVIFileGetStream
AVIFileInfo
AVIFileInit
AVIFileOpen
AVIFileRelease
AVIFileWriteData
AVIStreamGetFrame
AVIStreamGetFrameClose
AVIStreamGetFrameOpen
AVIStreamInfo
AVIStreamLength
AVIStreamReadFormat
AVIStreamRelease
AVIStreamStart
AVIStreamTimeToSample
capCreateCaptureWindow
capGetDriverDescription
DrawDibClose
DrawDibDraw
DrawDibOpen
mciGetDeviceID
mciGetErrorString
mciSendCommand
mciSendString
midiOutClose
midiOutGetDevCaps
midiOutGetNumDevs
midiOutOpen
midiOutReset
midiOutShortMsg
mixerClose
mixerGetControlDetails
mixerGetDevCaps
mixerGetID
mixerGetLineControls
mixerGetLineInfo
mixerGetNumDevs
mixerOpen
mixerSetControlDetails
mmioAscend
mmioClose
mmioCreateChunk
mmioDescend
mmioFlush
mmioOpen
mmioRead
mmioSeek
mmioWrite
PlaySound
sndPlaySound
timeGetDevCaps
waveInAddBuffer
waveInClose
waveInGetDevCaps
waveInGetErrorText
waveInGetNumDevs
waveInGetPosition
waveInOpen
waveInPrepareHeader
waveInReset
waveInStart
waveInStop
waveInUnprepareHeader
waveOutClose
waveOutGetDevCaps
waveOutGetErrorText
waveOutGetNumDevs
waveOutGetPosition
waveOutGetVolume
waveOutOpen
waveOutPrepareHeader
waveOutReset
waveOutSetVolume
waveOutUnprepareHeader
waveOutWrite
Code examples:
Adding supplementary data to AVI files
Changing pitch and speed of a wave file
Class for sound recording
Playing WAV sounds simultaneously
WAV file player
Playing WAV sounds simultaneously

User rating: 8/10 (1 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
This code is written in response to a question posted on UT: Ride two WAVs at once?

The sndPlaySound is not suitable for this. To play multiple sounds simultaneously, the waveOut* functions must be used.

See also:

  • WAV file player
  • WAV file recorder
  • How to play MIDI notes
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
      Buy this example for $10.00
    Instant email delivery.

    Read more...
     


    User rating: 8/10 (1 votes)
    Rate this code sample:
    • ~
    6885 bytes  
    Created: 2007-02-16 18:22:01  
    Modified: 2012-09-19 14:17:50  
    Visits in 7 days: 129  
    Listed functions:
    GlobalAlloc
    GlobalFree
    mmioAscend
    mmioClose
    mmioDescend
    mmioOpen
    mmioRead
    waveOutClose
    waveOutOpen
    waveOutPrepareHeader
    waveOutReset
    waveOutUnprepareHeader
    waveOutWrite
    Printer friendly API declarations
    My comment:
    The code above contains two classes. The WavPlayer class wraps API declarations and acts as a factory for creating instances of the WavSound class.

    On Init, an instance of WavSound opens specified WAV file, loads it in memory, and makes ready to be played.

    Here is a code for testing WavPlayer and WavSound classes.
    PUBLIC wp As WavPlayer
    wp = CREATEOBJECT("WavPlayer")

    wp.LoadWavSound("C:\WINDOWS\Media\Windows XP Logoff Sound.wav")
    wp.LoadWavSound("C:\WINDOWS\Media\Windows XP Startup.wav")
    wp.LoadWavSound("C:\WINDOWS\Media\Windows XP Logon Sound.wav")
    wp.LoadWavSound("C:\WINDOWS\Media\tada.wav")
    wp.LoadWavSound("C:\WINDOWS\Media\notify.wav")
    wp.LoadWavSound("C:\WINDOWS\Media\chord.wav")
    wp.LoadWavSound("C:\WINDOWS\Media\Windows XP Shutdown.wav")

    FOR nTimes=1 TO 1
            FOR nIndex=1 TO wp.WavSounds.Count
                    wp.PlayWavSound(m.nIndex)
                    = INKEY(0.1)
            NEXT
    NEXT

    Note that wp variable must not be released while the sounds are being played. For that reason it is declared PUBLIC.

    API function mmioRead is declared twice with two different interfaces. In VFP versions 3 to 7, these declarations must be moved to LoadWaveFile method of WavSound class and placed each before corresponding call.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.


    Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

    Privacy policy
    Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (107.20.7.65)
    13.28 min.Example: 'Finding the path to the VFP executable running'
    4.02 hrs.
     Function: 'CreateEllipticRgn'
     Example: 'Browsing Windows Known Folders (Special Folders)'
    5.65 hrs.Function: 'mixerOpen'
    7.66 hrs.Example: 'CryptoAPI: retrieving list of providers'
     Function: 'GdipDisposeImage'
    Function group: 'GDI+ Image'
     Function: 'SQLInstallerError'
    Function group: 'ODBC API'
    9.79 hrs.Example: 'How to copy the image of a form to the Clipboard using Bitmap API functions'
     Function: 'SHCreateDirectory'
    Function group: 'Shell Functions'
    Google
    Advertise here!