停止音频输入
The waveInStop function stops waveform-audio input.
MMRESULT waveInStop( HWAVEIN hwi //Handle to the waveform-audio input device; );
返回值:成功 MMSYSERR_NOERROR
Return code
Description | |
---|---|
| Specified device handle is invalid. |
| No device driver is present. |
| Unable to allocate or lock memory. |
重置输入音频(还原成之前的样子)
MMRESULT waveInReset( HWAVEIN hwi );
返回值和上面一样
The waveInPrepareHeader function prepares a buffer for waveform-audio input.
准备一个缓冲区来存储输入的音频
MMRESULT waveInPrepareHeader( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh );
清理waveInPrepareHeader,这个功能必须在调用设备驱动填充完缓冲区并且返回应用程序后调用,也就是在调用前必须释放缓冲区
MMRESULT waveInUnprepareHeader( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh );
waveInClose(HANDLE) 释放音频句柄
打开记录给定的音频输入
MMRESULT waveInOpen( LPHWAVEIN phwi, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwCallbackInstance, DWORD fdwOpen );
waveInAddBuffer
同理还用输出音频的API,类似
waveOutReset()
waveOutUnprepareHeader()
waveOutClose()