Share via


Managing Waveform-Audio Recording

After you open a waveform-audio input device, you can begin recording waveform-audio data. Waveform-audio data is recorded into application-supplied buffers specified by a WAVEHDR structure. These data blocks must be prepared before they are used; for more information, see Audio Data Blocks.

Windows provides the following functions to manage waveform-audio recording.

Function Description
waveInAddBuffer Sends a buffer to the device driver so it can be filled with recorded waveform-audio data.
waveInReset Stops waveform-audio recording and marks all pending buffers as done.
waveInStart Starts waveform-audio recording.
waveInStop Stops waveform-audio recording.

Use the waveInAddBuffer function to send buffers to the device driver. As the buffers are filled with recorded waveform-audio data, the application is notified with a window message, callback message, thread message, or event, depending on the flag specified when the device was opened.

Before you begin recording by using waveInStart, you should send at least one buffer to the driver, or incoming data could be lost.

Before closing the device using waveInClose, call waveInReset to mark any pending data blocks as being done.