support config referHook (#915)

This commit is contained in:
Hoan Luu Huu
2024-09-30 19:13:48 +07:00
committed by GitHub
parent b9ef00dfc7
commit b898b70520
3 changed files with 63 additions and 59 deletions

View File

@@ -74,6 +74,7 @@ class TaskConfig extends Task {
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 hasReferHook() { return Object.keys(this.data).includes('referHook'); }
get summary() {
const phrase = [];
@@ -104,6 +105,7 @@ class TaskConfig extends Task {
if (this.notifyEvents) phrase.push(`event notification ${this.notifyEvents ? 'on' : 'off'}`);
if (this.onHoldMusic) phrase.push(`onHoldMusic: ${this.onHoldMusic}`);
if ('boostAudioSignal' in this.data) phrase.push(`setGain ${this.data.boostAudioSignal}`);
if (this.hasReferHook) phrase.push('set referHook');
return `${this.name}{${phrase.join(',')}}`;
}
@@ -299,6 +301,10 @@ class TaskConfig extends Task {
mode: (this.vad.mode !== undefined && this.vad.mode !== null) ? this.vad.mode : 2
};
}
if (this.hasReferHook) {
cs.referHook = this.data.referHook;
}
}
async kill(cs) {