support mod_vad_detect (#762)

* support mod_vad_detect

* wip

* update verb spec and drachtio fsmrf

* Update example-voicemail-greetings.json (#761)

Update voicemail english greetings

* wip

* stopvad if playdone

---------

Co-authored-by: Vinod Dharashive <vdharashive@gmail.com>
This commit is contained in:
Hoan Luu Huu
2024-05-29 18:31:59 +07:00
committed by GitHub
parent 24b6d2464b
commit 498dd64025
7 changed files with 73 additions and 30 deletions

View File

@@ -15,7 +15,8 @@ class TaskConfig extends Task {
'transcribe',
'fillerNoise',
'actionHookDelayAction',
'boostAudioSignal'
'boostAudioSignal',
'vad'
].forEach((k) => this[k] = this.data[k] || {});
if ('notifyEvents' in this.data) {
@@ -70,6 +71,7 @@ class TaskConfig extends Task {
get hasListen() { return Object.keys(this.listen).length; }
get hasTranscribe() { return Object.keys(this.transcribe).length; }
get hasDub() { return Object.keys(this.dub).length; }
get hasVad() { return Object.keys(this.vad).length; }
get hasFillerNoise() { return Object.keys(this.fillerNoise).length; }
get summary() {
@@ -287,6 +289,16 @@ class TaskConfig extends Task {
cs.enableFillerNoise(opts);
}
}
if (this.hasVad) {
cs.vad = {
enable: this.vad.enable || false,
voiceMs: this.vad.voiceMs || 250,
silenceMs: this.vad.silenceMs || 150,
strategy: this.vad.strategy || 'one-shot',
mode: this.vad.mod || 2
};
}
}
async kill(cs) {