VoiceGuide IVR Software Main Page
Jump to content

Record into new file when silence heard

Recommended Posts

Question was asked about how to record into separate files when it is known that the sound spoken on the line will have silences in it.

In answer: this is easily achieved by just setting the silence length, and then recording as usual. The "on {silence} goto [...]" path will be taken when silence is encountered. The "on {silence} goto [...]" path can just point to another Record module to continue recording into new file after the silence.

Here is a sample script created to demonstrate how this is done:

image.thumb.png.2bf3eabae277789e2fb81b20482cd897.png

Here is the .VGS file itself (open .VGS in VoiceGuide Script Editor):

test1.vgs

The above demo script sets the silence length to be 1 second, and then records up to 4 sound files with script moving to next record module whenever a 1 second silence is heard.

To test this a call was placed into the system and this sound file was played when the "test1.vgs" script answered:

count_1_to_16_with_1sec_pauses.wav

image.thumb.png.196e888b6582d574efe937ca0740cc90.png

The sound file is a recording of a person saying 1 to 16, with 1.1 second silence gap after each 4th number spoken.

When tested, the system detected the 1 second silence gaps and as expected recorded this into 4 separate sound files.

Here is the  vgEngine trace capturing the call:

test1_vgengine.txt

and here are the 4 sound files recorded:

0424121608_225_73_.wav

0424121611_225_73_.wav

0424121614_225_73_.wav

0424121617_225_73_.wav

Here is one of the files opened in Audacity:

image.thumb.png.0dccad421413f2a97c1e40daefef909a.png

 

 

 

Share this post


Link to post

Please post the vgEngine trace capturing the call, and the recording made by [rec 1] module.

Share this post


Link to post

Please also post the sound file recorded by the 'record' type module. Trace shows it is this file: C:\callrecord\1.wav

Share this post


Link to post

Hi,

 

I still have problem with silence detection in record module. VG each time terminating with timeout parameter, not silence detection.

vg.ini

[PlayRecordConfig]

RecFormat=ALaw

RecEditor=SNDREC32.EXE

RecCut_EndRecDueTo_ToneDisconnect=30

RecCut_EndRecDueTo_ToneDtmf=2

RecCut_EndRecDueTo_DlgcDE_LCOF=10

RecLengthMin=1

RecLengthMax=3600

PlayEndPauseDialogic=0

PlayVolume=100

SilenceDetectLength=30

SilenceDetectLevel=75

 

log file restart including:

090905.737   9                     [PlayRecordConfig]:SilenceDetectLength = [30] => 30
090905.753   9                     [PlayRecordConfig]:SilenceDetectLevel = [75] => 75

 

Record Sound File module paths section including:

on {timeout 10} gosub [ad_asr.vgs|] return [call_theme]
on {silence} gosub [ad_asr.vgs|] return [call_theme]

log:

090946.337  22   5   1     1       find_next_vgm module title is=[call_theme_record] (trigger_used={timeout)
090946.337  22   5   1     1 t     timer clear force=False(RunModule_begin)
090946.338  22   5   1     1       RunModule start Record, [call_theme_record], iModuleIdx=196, previous: vgm=199, vgs=3:3
090946.338  22   5   1     1       [call_theme_record] VGMTYPE_REC run start
090946.338  22   5   1     1       rv    replace start [$RV[call_record_file]]
090946.338  22   5   1     1       rv    replace end   [theme.wav]
090946.338  22   5   1     1       rv    add   call_theme_record|theme.wav
090946.339  22   5   1     1       RecSoundStart [C:\callrecord\ID20200601_090936_150_1_50011_theme.wav] call beep=True
090946.339  22   5   1     1 state [call_theme_record] Recording theme.wav |
090946.340  22   5   1     1       q_tel +     cmd_SilenceDetectSet 0 [] [30,75,0,0,0,0,0,0][|||||||]
090946.340  23   5   1     1       q_tel run   cmd_SilenceDetectSet 0 0 [] 0 max:1|0
090946.346  22   5   1     1       rec_start strRecordOptionsXml=[]
090946.347  22   5   1     1       q_tel +     cmd_RecordFileStart 1668617233 theme.wav []
090946.347  22   5   1     1       rec_start [C:\callrecord\ID20200601_090936_150_1_50011_theme.wav] ok
090946.347  23   5   1     1       q_tel run   cmd_RecordFileStart 0 1668617233 [] 0 max:1|0
090946.347  22   5   1     1 t     timer set   10 sec : EV_TIMEOUT_GOTOMODULE
090946.347  22   5   1     1       RunModule finish
090956.281  18   5   1     1 timer EV_TIMEOUT_GOTOMODULE
090956.281  18   5   1     1       q_scr +     evScriptEvent 9002 EV_TIMEOUT_GOTOMODULE
090956.281  22   5   1     1       q_scr run   evScriptEvent 9002 EV_TIMEOUT_GOTOMODULE action_id=0, crn=0 [0|0|0|0|0][|||||] 00:00:00 max:1|178,6237
090956.282  22   5   1     1       evscr EV_TIMEOUT_GOTOMODULE 9002  0|0|0  || LineState=LS_REC_RECORDING
090956.292  22   5   1     1       LsRecRecording EV_TIMEOUT_GOTOMODULE,EV_TIMEOUT_GOTOMODULE  0|0|0  ||
090956.292  22   5   1     1       path {EV_TIMEOUT_GOTOMODULE} not found
090956.294  22   5   1     1       rec_stop begin trunc100ms=0, sCaller=EV_TIMEOUT_GOTOMODULE, lRecId=1668617233
090956.294  22   5   1     1       rec_stop lRec_Id_InProcessOfStopping=1668617233, lRecId=0
090956.295  22   5   1     1       q_tel +     cmd_RecordStop [0,0,0,0,0][||||]
090956.295  23   5   1     1       q_tel run   cmd_RecordStop 0 0 [] 0 max:1|0
090956.297  22   5   1     1       rv    rec length: call_theme_record_RecLen100ms = 99
090956.297  22   5   1     1       rv    add   call_theme_record_RecLen100ms|99
090956.297  22   5   1     1       rv    add   call_theme_record_EndRecCause|timeout
090956.297  22   5   1     1       find_next_vgm module title is=[ad_asr.vgs|] (trigger_used={timeout)
090956.298  22   5   1     1       gosub directive found
090956.298  22   5   1     1       return directive found: call_theme

 

Can You help?

 

0601_ktTel.zip

Share this post


Link to post

Please post the full ktTel trace and the " C:\callrecord\ID20200601_090936_150_1_50011_theme.wav"  file.

We can the see what has happened on the syetem ad advise.

Please .ZIP up the traces before posting.

 

Share this post


Link to post

Please post the full ktTel trace that includes the system startup..

If system startup was done on different day then please stop the VoiceGuide service, then start the VoiceGuide service, then repeat the test, and then post both the full ktTel trace and the .WAV file.

Share this post


Link to post

Hi!

in line 662 You find system startup data.


007 090907.972 210776               ------------------------------------------------------------------------------
008 090907.972 210776               DLL ktTel_sr271 v7.6.21, Mar 26 2020 18:58:32
009 090907.972 210776               start at 0601 090907.972

Share this post


Link to post

Can you try updating that system to latest version of VoiceGuide and running the record test again?

Share this post


Link to post

VG updated to
200844.584   9                     vgEngine : 7.6.25 - 7.6.7454.39618
200844.584   9                     compiled : 2020-05-29 22:00:34.23

 

200945.154  17   5   1     1       find_next_vgm module title is=[call_theme_record] (trigger_used={timeout)
200945.154  17   5   1     1 t     timer clear force=False(RunModule_begin)
200945.154  17   5   1     1       RunModule start Record, [call_theme_record], vgm=196, previous_vgm=199
200945.154  17   5   1     1       [call_theme_record] VGMTYPE_REC run start
200945.154  17   5   1     1       rv    replace start [$RV[call_record_file]]
200945.155  17   5   1     1       rv    replace end   [ID20200601_200935_150_1_50011_theme.wav]
200945.155  17   5   1     1       rv    add   call_theme_record|C:\callrecord\ID20200601_200935_150_1_50011_theme.wav
200945.155  17   5   1     1       RecSoundStart [ID20200601_200935_150_1_50011_theme.wav] call beep=True
200945.155  17   5   1     1 state [call_theme_record] Recording C:\callrecord\ID20200601_200935_150_1_50011_theme.wav | 
200945.156  17   5   1     1       q_tel +     cmd_SilenceDetectSet 0 [] [30,75,0,0,0,0,0,0][|||||||]
200945.157  18   5   1     1       q_tel run   cmd_SilenceDetectSet 0 0 [] 0 max:1|0,9974
200945.162  17   5   1     1       rec_start strRecordOptionsXml=[]
200945.163  17   5   1     1       q_tel +     cmd_RecordFileStart 1784478201 ID20200601_200935_150_1_50011_theme.wav []
200945.163  17   5   1     1       rec_start [C:\callrecord\ID20200601_200935_150_1_50011_theme.wav] ok
200945.163  18   5   1     1       q_tel run   cmd_RecordFileStart 0 1784478201 [] 0 max:1|0,9974
200945.164  17   5   1     1 t     timer set   10 sec : EV_TIMEOUT_GOTOMODULE
200945.164  17   5   1     1       RunModule finish
200955.098  12   5   1     1 timer EV_TIMEOUT_GOTOMODULE
200955.098  12   5   1     1       q_scr +     evScriptEvent 9002 EV_TIMEOUT_GOTOMODULE
200955.098  17   5   1     1       q_scr run   evScriptEvent 9002 EV_TIMEOUT_GOTOMODULE action_id=0, crn=0 [0|0|0|0|0][|||||] 00:00:00 max:1|173,0027
200955.099  17   5   1     1       evscr EV_TIMEOUT_GOTOMODULE 9002  0|0|0  || LineState=LS_REC_RECORDING
200955.109  17   5   1     1       LsRecRecording EV_TIMEOUT_GOTOMODULE,EV_TIMEOUT_GOTOMODULE  0|0|0  ||
200955.109  17   5   1     1       path {EV_TIMEOUT_GOTOMODULE} not found
200955.111  17   5   1     1       rec_stop begin trunc100ms=0, sCaller=EV_TIMEOUT_GOTOMODULE, lRecId=1784478201
200955.111  17   5   1     1       rec_stop lRec_Id_InProcessOfStopping=1784478201, lRecId=0
200955.111  17   5   1     1       q_tel +     cmd_RecordStop [0,0,0,0,0][||||]
200955.112  18   5   1     1       q_tel run   cmd_RecordStop 0 0 [] 0 max:1|0,9974
200955.114  17   5   1     1       rv    rec length: call_theme_record_RecLen100ms = 99
200955.114  17   5   1     1       rv    add   call_theme_record_RecLen100ms|99
200955.115  17   5   1     1       rv    add   call_theme_record_EndRecCause|timeout

 

0601_ktTel.zip

ID20200601_200935_150_1_50011_theme.wav

Share this post


Link to post

Hi,

 

now VG working properly:

150032.300  35   5   1     1 ev    Silence
150032.301  35   5   1     1       q_scr +     evScriptEvent 9300 EV_SILENCE_DETECTED
150032.301  35   5   1     1 ev    Dialogic 130,TDX_RECORD, crn=6000005, 0,0,0,TM_MAXSIL,,
150032.301  17   5   1     1       q_scr run   evScriptEvent 9300 EV_SILENCE_DETECTED action_id=0, crn=0 [0|0|0|0|0][|||||] 00:00:00 max:1|175,0008
150032.301  35   5   1     1       q_scr +     evScriptEvent 130 TDX_RECORD
150032.301  17   5   1     1       evscr EV_SILENCE_DETECTED 9300  0|0|0  || LineState=LS_REC_RECORDING
150032.310  35   5   1     1 ev    RecEnd 1833338246 ||
150032.310  35   5   1     1       q_scr +     evScriptEvent 8003 EV_REC_FINISHED
150032.311  17   5   1     1       LsRecRecording EV_SILENCE_DETECTED,EV_SILENCE_DETECTED  0|0|0  ||
150032.312  17   5   1     1       path {EV_SILENCE_DETECTED} not found
150032.314  17   5   1     1       rec_stop begin trunc100ms=30, sCaller=EV_SILENCE_DETECTED, lRecId=1833338246
150032.314  17   5   1     1       rec_stop lRec_Id_InProcessOfStopping=1833338246, lRecId=0
150032.314  17   5   1     1       q_tel +     cmd_RecordStop [3000,0,0,0,0][||||]
150032.315  18   5   1     1       q_tel run   cmd_RecordStop 0 0 [] 0 max:1|0
150032.316  17   5   1     1       rv    rec length: call_theme_record_RecLen100ms = 64
150032.316  17   5   1     1       rv    add   call_theme_record_RecLen100ms|64
150032.316  17   5   1     1       rv    add   call_theme_record_EndRecCause|silence
150032.317  17   5   1     1       path {silence} found (at offset 104)
150032.317  17   5   1     1       find_next_vgm module title is=[asr.vgs|] (trigger_used={silence})
150032.317  17   5   1     1       gosub directive found

 

but wav file is cuted on the end ( last 3 seconds declared as silence) and in this case SST lost last word. Adding 1 second on the end of call record solve problem.
Can VG leave whole call record without cutting off "silence" part of record , only detecting silence?

 

ID20200603_145408_150_1_50011_theme.wav

Share this post


Link to post

The reason why silence was not detected in ID20200601_200935_150_1_50011_theme.wav file was due to too much background noise after the main speech recording.

Here is the plot of that file. The noise at end is visible:

image.png.e59f53ba5584804b1fb9f9743100b071.png

 

In the D20200603_145408_150_1_50011_theme.wav recording the silence was detected.

In cases where silence is detected while recording, that silence is by default deleted from the end of recording.

image.png.bfd4202231a7d7e149493aa615ed6dd4.png

In D20200603_145408_150_1_50011_theme.wav this looks like resulted in a bit too much of the end of the sound file being deleted.

To allow better control over how much the recording is shortened by  when silence is detected, the setting

RecCut_EndRecDueTo_Silence

has been added to VG.INI, section [PlayRecordConfig].

You can add this to your existing VG.INI, section [PlayRecordConfig]:

;How much should be trimmed from the end of recorded file if silence is detected. In 100ms units
;30 = 3 seconds trimmed off the end of the recording
;0 = no sound data trimmed from end of the recording
;-X = length trimmed is equal to "SilenceDetectLength - (X*100ms)"
;eg: -3 results in truncation of: SilenceDetectLength - 300ms
;eg: if SilenceDetectLength=30, the setting of -3 will result in 2700ms trimmed from end of recording.
RecCut_EndRecDueTo_Silence=-3

This setting will be available in v7.6.28 onwards.

 

Share this post


Link to post

The setting

RecCut_EndRecDueTo_Silence

can also be set during the call, by setting a value of this Result Variable:

$RV[ini_PlayRecordConfig_RecCut_EndRecDueTo_Silence]

eg: this will set RecCut_EndRecDueTo_Silence to a value of 20, which will result in 2 seconds cut off the end of recording if recording ends due to silence being detected:

set_rv_in_eval_module.png.e7d0c357cf3e7afec6f05a5b0e3406ab.png

Share this post


Link to post

Question is how to disable silence detection in case of call recording?

During call record called from VB Script:
 

set vg = CreateObject("vgServices.CommandLink")
vg.Admin_TraceLogAdd $RV[Conf_LineId_1], 0, "rec_2lines $RV[session_id] call"
vg.Record_Start $RV[Conf_LineId_1], "$RV[session_id]_$RV_HH$RV_NN$RV_SS_L.wav", 0
vg.Record_Start $RV[Conf_LineId_2], "$RV[session_id]_$RV_HH$RV_NN$RV_SS_P.wav", 0
vg.Admin_TraceLogAdd $RV[Conf_LineId_1], 0, "rec_2lines $RV[session_id] returned"
vg.Run_ResultReturn $RV[Conf_LineId_1], "success"
set vg = Nothing

call recording is docked in empty play module with paths:

on {success} goto [Hangup the Call]
on {timeout 3600} goto [Hangup the Call]
on {LineEvCallState_DISCONNECTED} goto [Hangup the Call]

but VG stop recording when silence was detected (call wasn't terminated). 

 

 

Share this post


Link to post

To disable silence detection this setting should be set to 0.

SilenceDetectLevel 

That setting is in VG.INI, in section [PlayRecordConfig]

SilenceDetectLevel can also be set during the call, by assigning a value to this Result Variable:

$RV[SilenceDetectLevel]

eg:

image.png.32a4255dc2890159caf69226277357c2.png

 

or from Run Script module like this:

vg.RvSet $RV_LINEID, "SilenceDetectLevel", "0"

or

vg.RvSet_RvList $RV_LINEID, "[SilenceDetectLevel]{0}"

etc.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×