Places the file in a temporary directory for the life of the script. To save a file from a script, it must be subsequently moved to any permanent storage location.

Audio Recording Component

:icons:font :hardbreaks: :imagesdir: ../../../assets/images :toc-title: Contents :toc:

Description

Records sound coming from the subscriber to a local file. +\

Table 1. System characteristics

Index

208

Short name

record

Script types

IVR

Start module

r_sip_ivr_script_component_record

Mode

Asynchronous

Icon

208

Branching type

Branching, closing

Properties

Table 2. Properties
Specification Description

Name: Mode Code: mode Visibility condition: no Default: Synchronous recording

"Select recording mode. Possible options:

  • Synchronous recording (syncRecFile

0) - the usual mode of recording to a file, followed by packaging in the selected codec and returning the file path to a variable.

  • Streaming recording (growingRaw

1) - recording mode to the specified file in short portions, for example, to organize streaming sending to the speech recognition service by external means.

Name: Path to variable Code: pathToVarMode Visibility condition: yes

Default: Yes"

"Switch to save the path to the file and write it to a variable."

Name: Path to file in variable Code: nameVar Visibility condition: yes Default: — 

"Variable for saving the path to the file with the recorded voice. Applicable only in synchronous recording mode. The file is located in the script’s temporary directory and will be deleted when the script completes.

To save a file for a long time

the script requires further movement of the file to a permanent storage location.

The recording is carried out on a server with the mg role

serving the current call, and then transferred to a server with the ivr role, serving the current scenario. The transfer always takes place within the site.

Name: Path to file Code: toFilepath Visibility condition: yes

Default: --"

"Argument specifying the path to the file for streaming recording (growing file). Applicable only in streaming recording mode.

Name: Wav title Code: addWavHeader Visibility condition: yes

Default: No"

"Allows you to add a wav header to a growing file. Applicable only in streaming recording mode. The Wav header contains a size equivalent to the selected maximum recording time.

Name: Codec Code: codec Visibility condition: yes

Default: `PCMA`"

"Codec/recorded file format (for synchronous recording mode only). Packing is done upon completion of recording using a mixer. Possible options:

  • PCM (pcm

'0')

  • PCMA (pcma

'1')

  • PCMU (pcmu

'2')

  • GSM (gsm

'3')

  • MP3 8 kHz 8 kbit/s (mp3_8_8

'4')

  • MP3 8 kHz 16 kbit/s (mp3_8_16

'5')

  • MP3 8 kHz 24 kbit/s (mp3_8_24

'6')

  • MP3 16 kHz 32 kbit/s (mp3_16_32

'7')

  • MP3 16 kHz 48 kbit/s (mp3_16_48

'8')

Name: Codec Code: codecRaw Visibility condition: yes

Default: `PCMA`"

"Codec/recorded file format (for streaming recording mode only). Possible options:

  • L16/8000 (pcm8000

'0') - PCM 8000 Hz 16 bit mono.

  • L16/16000 (pcm16000

'1') - PCM 16000 Hz 16 bit mono.

Name: Buffer

ms Code: bufferDurMs Visibility condition: no

Default: 250"

"Argument defining the period for flushing recorded data to the stream file. Applies only to streaming recording mode.

Name: Timeout

s Code: recTimeSec Visibility condition: no

Default: --"

"Recording timeout before automatic interruption, in seconds."

Name: Buffer for DTMF Code: dtmfBuffer Visibility condition: no Default: — 

"Variable for storing received DTMF characters."

Name: Clear DTMF buffer Code: clearDtmfBuffer Visibility condition: yes Default: Yes

"DTMF buffer pre-clear switch."

Name: Number of characters Code: maxSymbolCount Visibility condition: no Default: — 

"An argument containing a limit on the number of characters entered.

After receiving the specified number of DTMF characters during the execution of a component

the recording is automatically completed and the last portion of voice data is sent to the recognition service."

Name: Interrupt characters Code: interruptSymbols Visibility condition: no Default: — 

"A string containing sequences of break characters separated by commas.

After detecting a character sequence at the end of the DTMF buffer that matches one of the specified interrupt sequences

the recording is automatically completed and the last portion of data is sent to the recognition service.

For example

*, 7, 123, 9395."

Name: Cut interrupt characters Code: clearInterrupt Visibility condition: yes Default: Yes

"Switch for the operation of removing interrupt characters from the DTMF buffer after detecting an interrupt sequence."

Name: Break background (layer) when voice detected Code: `stopPlayerIdOnVad Visibility condition: no Default: "default"

"Background playback layer (the playerId field of the background playback component launched earlier), which should be stopped when a voice is detected in the subscriber’s channel.

Name: Abort when silence is detected Code: abortOnSilence Visibility condition: no

Default: No"

"Silence detection and automatic interrupt mode switch. Silence is considered to be a signal below the sensitivity threshold with a length of more than 200 ms.

The timer starts only after a voice is detected (a signal above the sensitivity threshold lasting more than half a second

within which signal zones below the sensitivity threshold lasting less than 200 ms can be detected).

Name: Silence interval, s Code: silenceTimeoutSec Visibility condition: yes Default: 2

"Argument containing the timeout time when silence is detected in seconds. If a voice is heard above the sensitivity threshold within the specified timeout, the timer is reset until silence is detected again.

In most cases

2 seconds is a comfortable interval.

Can be specified in decimal format

for example '1.6'.

Name: VAD Threshold

-dB Code: vadThreshold Visibility condition: yes

Default: `30`"

"Argument setting the VAD threshold. VAD detector parameter. The specified value is used with a negative sign (in decibels) to determine the silence cutoff threshold relative to the possible maximum. The stream is analyzed in 20 ms frames. Each audio frame is considered either voice or silence (the average loudness level of the frame) based on a cutoff threshold.

Thus

the detector has two states: voice and silence. When transitioning between states, an event is generated about the transition to another state. Initially, the detector is in a silent state.

The generation of a voice detection signal occurs in a state of silence when several frames in a row are voice (parameter 'Voice threshold

ms').

The generation of a silence detection signal occurs in the voice state after several frames in a row are recognized as silence (the 'Silence threshold

ms' parameter).

With a value of 30

the detector better detects silence; with a value of 40, the detector better detects the appearance of a voice.

The component exits after the timeout specified in the Silence interval

s field has expired, counting from the beginning of the silence segment detected by the detector from the voice state.

Name: Voice

min. duration, ms Code: vadVoiceMinMs Visibility condition: yes

Default: `120`"

"Argument that sets the minimum threshold VAD duration for generating the VAD UP signal. VAD detector parameter.

To generate a signal

several 20 ms frames in a row are required with an average level above the set VAD threshold. The specified value determines the number of frames.

Name: Voice

tolerance, % Code: vadVoiceTol Visibility condition: yes

Default: `20`"

"An argument that sets the permissible deviation in the sequence of voice frames. VAD detector parameter.

For example

the minimum duration is set to 210 (ms), deviation 20 (%). Thus, signaling the presence of voice would require a sequence of 11 frames, 9 of which would be voice frames. A value of 0 means that all 11 frames in a row must be voice (have an average level above the VAD threshold).

Name: Silence

min. duration, ms Code: vadSilenceMinMs Visibility condition: yes

Default: `500`"

"An argument that sets the minimum threshold duration of frames with silence for generating the VAD DOWN signal. VAD detector parameter.

To generate a signal

several 20 ms frames in a row are required with an average level below the set VAD threshold. The specified value determines the number of frames.

Name: Silence

tolerance, % Code: vadSilenceTol Visibility condition: yes

Default: `10`"

"An argument that sets the permissible deviation in the sequence of voice frames. VAD detector parameter.

For example

the minimum duration is set to 210 ms, deviation 20%. Thus, signaling the presence of voice would require a sequence of 11 frames, 9 of which would be voice frames. A value of 0 means that all 11 frames in a row must be silent (have an average level below the VAD threshold).

Name: Transition Code: transfer Visibility condition: no

Default: --"

"The component to which control is transferred upon completion of the operation of typing the required number of characters."

Name: Transition, time Code: transferTimeout Visibility condition: no Default: — 

"The component to which control is transferred upon completion due to a timeout."

Name: Transition, error Code: transferError Visibility condition: no Default: — 

"The component to which control is transferred when an error is detected, for example, the path to the file for streaming recording is incorrectly specified."