home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Learn 3D Graphics Programming on the PC
/
Learn_3D_Graphics_Programming_on_the_PC_Ferraro.iso
/
rwwin
/
abstract.tx_
/
abstract.bin
Wrap
Text File
|
1995-11-14
|
3KB
|
82 lines
WAVEMIX: Plays Multiple .WAV Files Simultaneously
WAVEMIX.DLL is a utility that allows multiple .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 DLL (dynamic-link library) supports eight
channels of simultaneous wave play, the ability to queue
waves along the same channel, and wave completion
notification.
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 WaveMixOpenFile.
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 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 using WaveMixCloseChannel.
2. Free the memory for the waves 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, see the
WAVEMIX.TXT file included in this sample. For more
information on mixing sounds, see the MIXDESCR.DOC file.
KEYWORDS: CD7