Command: record

Syntax

record { <file>, <panel> {,<format>} }

Description

Record a sound file.

Parameters

When a recording is being initiated, the following parameters must be present. When a recording is being stopped, cancelled or restarted, via one of the command switches, the parameters should be omitted.

Switches

Notes

The maximum size for an audio file is 4 megabytes. Recording will stop if this limit is reached.

Use the value of the recording identifier if you wish to test whether a file is currently open for recording.

Examples

Create a dialog window to control the recording of an audio file.

window panw = wpanel {
    row {# A row of buttons ...
        rec: button 'Record',-gh
        rew: button 'Rewind'
        sav: button 'Save'
        can: button 'Cancel'
    }
}
# Get the file name from the operator
string f = choosefile(1,null,12)
# Test for abort (this code would typically be within a macro)
unless (f) return
# Initiate the record process, using the Record button
record f, panw.rec, '22.05 kHz, mono, 8-bit'
# Set callbacks on the other buttons
panw.can.exec = { record -can }
panw.rew.exec = { record -rew }
panw.sav.exec = { record -sav }

See Also

Commands:

sound

Identifiers:

audio (numeric), audio_formats (string), recording (numeric)