home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fun Online 1996 September
/
FOL0996.iso
/
GEARDEMO
/
WAVEMIX
/
ABSTRACT.TXT
< prev
next >
Wrap
Text File
|
1995-03-02
|
3KB
|
91 lines
WAVEMIX: Plays Multiple .WAV Files Simultaneously
THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. WE REGRET THAT MICROSOFT IS UNABLE TO SUPPORT OR
ASSIST YOU SHOULD YOU HAVE PROBLEMS USING THIS TOOL.
WAVEMIX.DLL is a utility that allows multiple wave (.WAV)
files to play simultaneously. It is designed to be as
simple to use as possible but still have the power
required by games. The dynamic-link library (DLL) supports
eight channels of simultaneous wave play, the ability to
queue waves along the same channel, and wave completion
notification. The source code for the DLL is not included
in this sample.
WAVEMIX.DLL currently supports 11.025 kHz, 22.05 kHz, and
44.1 kHz 8-bit mono. Wave conversion from the file format
is done automatically to the output sampling rate when the
file is opened. The sampling rate is set in WAVEMIX.INI.
(See the WAVEMIX.INI file for details.) Stereo files and
16-bit files are converted to 8-bit mono when the wave is
loaded. The application programming interface (API)
consists of the following functions:
> HANDLE WINAPI WaveMixInit(void);
> HANDLE WINAPI WaveMixActivate(HANDLE hMixSession, BOOL
fActivate);
> LPMIXWAVE WINAPI WaveMixOpenWave(HANDLE hMixSession,
LPSTR szWaveFilename, HINSTANCE hInst, DWORD
dwFlags);
> UINT WINAPI WaveMixOpenChannel(HANDLE hMixSession, int
iChannel, DWORD
dwFlags);
> UINT WINAPI WaveMixPlay(LPMIXPLAYPARAMS
lpMixPlayParams);
> UINT WINAPI WaveMixFlushChannel(HANDLE hMixSession, int
iChannel,
DWORD dwFlags);
> UINT WINAPI WaveMixCloseChannel(HANDLE hMixSession, int
iChannel,
DWORD dwFlags);
> UINT WINAPI WaveMixFreeWave(LPMIXWAVE lpMixWave);
> UINT WINAPI WaveMixCloseSession(HANDLE hMixSession);
void WINAPI WaveMixPump(void);
> WORD WINAPI WaveMixGetInfo(LPWAVEMIXINFO
lpWaveMixInfo);
To play a file, a program must:
1. Initialize the DLL with WaveMixInit.
2. Open a wave file with WaveMixOpenWave.
3. Open a channel with WaveMixOpenChannel.
4. Call WaveMixActivate(TRUE) to tell WAVEMIX.DLL to
actually get the wave output device (see Note 1 below).
5. Play the file by using WaveMixPlay.
A given channel can be silenced by calling
WaveMixFlushChannel at any time.
When the program is finished playing sounds, it should:
1. Close the open channels by using WaveMixCloseChannel.
2. Free the memory for the waves by using
WaveMixFreeWave.
3. End the session with WaveMixCloseSession.
Note 1: An application should call WaveMixActivate(FALSE)
when it loses the focus, so that the waveform device can
be freed for other applications. When focus is regained,
the application can call WaveMixActivate(TRUE).
Note 2: An application that does not release the processor
can cause the sound to "skip." To avoid this, it can call
WaveMixPump frequently.
For more information on the above functions, refer to the
WAVEMIX.TXT file included in this sample. For more
information on mixing sounds, refer to the MIXDESCR.TXT
file.
KEYWORDS: CD7; CD9 (revised); CD11 (revised)