Recording
The general
MCI specification supports recording with digital-video, MIDI sequencer,
video-cassette recorder (VCR), and waveform-audio devices; however, only
waveform-audio and VCR devices currently implement recording capabilities. You
can insert or overwrite recorded information into an existing file or record
into a new file. To record to an existing file, open a waveform-audio device
and file as you would normally. To record into a new file, when you open the
device specify new as the device name if you are using the command-string
interface. If you are using the command-message interface, specify a
zero-length filename.
When MCI
creates a new file for recording, the data format is set to a default format
specified by the device driver. To use a format other than the default format,
you can use the set
To begin
recording, use the record
If you record
in insert mode to an existing file, you can use the from (MCI_FROM) and to
(MCI_TO) flags of the record command to specify starting and ending
positions for recording. For example, if you record to a file that is 20
seconds long, and you begin recording at 5 seconds and end recording at 10 seconds,
the resulting file will be 25 seconds long. The file will have a 5-second
segment inserted 5 seconds into the original recording.
If you record
with overwrite mode to an existing file, you can use the from and to flags
to specify starting and ending locations of the section that is overwritten.
For example, if you record to a file that is 20 seconds long, and you begin
recording at 5 seconds and end recording at 10 seconds, you still have a
recording 20 seconds long, but the section beginning at 5 seconds and ending at
10 seconds will have been replaced.
If you do not
specify an ending location, recording continues until you send a stop
The record
Saving a Recorded File
When
recording is complete, use the save
Note If you close
the device without saving, the recorded data is lost.
Checking Input Levels (PCM Only)
To get the
level of the input signal before recording on a PCM (Pulse Code Modulation)
waveform-audio input device, use the status
The input
level is represented as an unsigned value. For 8-bit samples, this value is in
the range 0 through 127 (0x7F). For 16-bit samples, it is in the range 0
through 32,767 (0x7FFF).