Audio recording to MP3 or WAV files
Audio recording to MP3 or WAV files
Recording of the audio stream coming out of the current audio capture device:
- disable the current video capture device: set VideoDevice = -1 ( * ), then select the index of the AudioDevice in the AudioDevices list,
- invoke StartAudioRecording.
**( * ) otherwise it would be used first if it exposes an audio stream, see below.
Recording of the audio stream coming out of the current video capture device:
For video capture devices that expose an audio output:
- select the index of the VideoDevice in the VideoDevices list,
- invoke StartAudioRecording.
".WAV" recording
By default, if no audio compressor is selected, the recording is made in ".WAV" format, and the ".wav" extension will be added automatically to the recorded file name.
".MP3" and ".WMA" recording
The recording is made in MP3 when RecordingMethod = rm_MP3 (or when the RecordingFileName extension is ".mp3"), and in WMA when RecordingMethod = rm_WMA (or ".wma"), by using the Microsoft MP3 / WMA encoders (MP3: Windows 8 or later), 128 kb/s by default. The WMA bit rate can be set with ASFAudioBitRate.
E.g.:
procedure TForm1.MP3AudioRecording;
begin
VideoGrabber.VideoDevice:= -1; // do not use the video capture device
VideoGrabber.AudioDevice:= 0; // e.g. we use the first audio device in the AudioDevices list
VideoGrabber.RecordingMethod:= rm_MP3; // or rm_WMA
VideoGrabber.StartAudioRecording;
end;
Selecting the right or left channel. It is possible to convert the right channel or the left channel to "mono" and to mute either the left, right or both channels with AudioChannelRenderMode.
Selecting the audio stream. When the clip has multiple audio streams it is possible to select one audio stream, see AudioStreamNumber