record
Record the call audio in the foreground. Use this, for example, to record voicemails.
Parameters
Name | Type | Description |
---|---|---|
stereo | boolean | Whether to record in stereo mode. Optional. Default false . |
format | string | Optional format ("wav" or "mp3" ). Default "wav" . |
direction | string | Optional direction of the audio to record: "speak" for what party says, "hear" for what party hears. Default "speak" . |
terminators | string | Optional string of digits that will stop the recording when pressed. Default "#" . |
beep | boolean | Whether to play a beep before recording. Optional. Default false . |
input_sensitivity | number | How sensitive the recording voice activity detector is to background noise. A larger value is more sensitive. Allowed values from 0.0 to 100.0 . Optional. Default 44.0 . |
initial_timeout | number | How long, in seconds, to wait for speech to start. Optional. Default 4.0. |
end_silence_timeout | number | How much silence, in seconds, will end the recording. Optional. Default 5.0. |
Variables
Set by the method:
- record_url: (out) the URL of the newly created recording.
- record_result: (out)
success
|failed
.
Examples
Record some audio and play it back
- YAML
- JSON
version: 1.0.0
sections:
main:
- record:
end_silence_timeout: 5
- play: "%{record_url}"
{
"version": "1.0.0",
"sections": {
"main": [
{ "record": { "end_silence_timeout": 5.0 } },
{ "play": "%{record_url}" }
]
}
}