The information in this article applies to:
SUMMARYThe code example below shows how to play waveform (.WAV) files from within FoxPro for Windows. This code can be placed in several different snippets including SETUP, VALID, WHEN, and MORE. MORE INFORMATIONThe example below uses the FoxTools library to call a function in MMSYSTEM.DLL. This dynamic-link library (DLL) is shipped with Windows 3.1 and is located in the Windows SYSTEM subdirectory (usually C:\WINDOWS\SYSTEM).
The sndPlaySound() function plays a waveform sound specified by a
filename or by an entry in the [Sounds] section of the WIN.INI file.
If the sound can't be found, it plays the default sound specified by
the SystemDefault entry in the [Sounds] section of the WIN.INI file.
If there is a now SystemDefault entry or if the default sound can't be
found, the function makes no sound and returns FALSE.
MWAVE specifies the name of the sound to play. The function searches the [Sounds] section of the WIN.INI file for an entry with this name and plays the associated waveform file. If no entry by this name exists, it assumes the name is the name of a waveform file. If this parameter is NULL, any currently playing sound is stopped. (For example, MWAVE="SystemStart" will play the waveform file associated with Windows starting, and MWAVE=0 will stop any currently playing sound.) MFLAG specifies options for playing the sound using one or more of the following flags:
NOTE: To use more than one option, add the numbers together. [For
example, use 11 to play the sound repeatedly; if the sound cannot
be found, sndPlaySound() will not play the default sound.]
The sound must fit in available physical memory and be playable by an installed waveform audio device driver. The directories searched for sound files are, in order: the current directory; the Windows program directory; the Windows SYSTEM subdirectory; the directories listed in the PATH environment variable in the AUTOEXEC.BAT file; the list of directories mapped in a network. REFERENCESMicrosoft Windows with Multimedia "Programmer's Reference," version 1.0 Additional query words: kbsound VFoxWin FoxWin 2.50 wave form WAV wave
Keywords : kbcode kbmm FxprgFoxtools |
Last Reviewed: August 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |