record { <file>, <panel> {,<format>} }
Record a sound file.
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.
<file>
The file to be recorded. The default file extension for Windows systems is .wav. For Sun/Solaris it is .au. For other systems there is no default extension.
<panel>
A button panel to be used to stop/start the actual recording process.
This must exist as a sub-panel of a panel window. Recording will take
place while the button is depressed, and paused when it is released.
<format>
A string value indicating the audio format to be used during recording.
Possible values can be found in the system string array audio_formats.
A suitable default will be used if this parameter is omitted.
-can
Cancel the recording. The audio file will not be written and the record
process will be terminated.
-rew
Rewind the recording. Any recording so far will be discarded and the record
process will restart, as if the record command had
been re-issued with its original parameters.
-sav
Finish the recording. The recod process will stop and the audio file will
be written.
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.
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 }
Commands: |
|
Identifiers: |
audio (numeric), audio_formats (string), recording (numeric) |