Py Session RecordFile
Records audio data to a file.
recordFile(filename, <[max_len]>, <[silence_threshold]>, <[silence_secs]>)
- filename - Full path to filename to write.
- max_len - maximum length of the recording in seconds.
- silence_threshold - energy level audio must fall below to be considered silence (500 is a good starting point).
- silence_secs - seconds of silence to interrupt the record.
Will return anything returned by the callback function, or true/false if no callback is used.
Note: the file must contain an extension known to freeswitch so it can determine the filetype to write. Freeswitch will abort the script if the extension is not provided.
A callback function can be used to process DTMF signals that are pressed during the recording. You can use them to abort the recording.
The callback function must be set by setDTMFCallback and should return "stop" in order to stop the recording.
NOTE: not tested with Python, though they should work.
You can specify a number of variables that will be used when saving the file. The variables must be set by using session.setVariable. The variables that can be set are:
rtn = session.recordFile("\tmp\recording.wav", 240, 500, 3);