AudioCaptureMgr::SetAudioCaptureProc
Defined in: C4AudioCapture.h
Installs a callback procedure that receives raw captured audio data.
Prototype
void SetAudioCaptureProc(AudioCaptureProc *proc, void *cookie = nullptr);
Parameters
proc |
A pointer to the audio capture callback procedure.
|
cookie |
The cookie that is passed to the callback procedure as its last parameter.
|
Description
The SetAudioCaptureProc function installs a callback procedure that is periodically invoked when new audio data has been captured on the local machine. This function is provided so that an application may interpret the audio data in whatever way it wishes (e.g., speech recognition). The AudioCaptureProc type is defined as follows.
typedef void AudioCaptureProc(unsigned_int32 timeStamp, const Sample *sampleData, int32 sampleCount, void *cookie);
When the callback procedure is called, the timeStamp parameter is set to the starting sample index. This value begins at zero and increases by the number of samples reported every time the callback procedure is called. When the time stamp reaches the size limit of a 32-bit integer, it wraps around. The sampleData parameter contains a pointer to the raw audio data, in uncompressed mono PCM format with 16 bits per sample. The sampleCount parameter contains the number of audio samples. The cookie parameter contains the value passed to the cookie parameter of the SetAudioCaptureProc function.
|