fix setting initial config

This commit is contained in:
akirilyuk
2022-02-04 08:12:53 +01:00
parent eb418a42e9
commit 418baa20df
3 changed files with 29 additions and 32 deletions

View File

@@ -99,7 +99,6 @@ class Cognigy extends Task {
await super.exec(cs); await super.exec(cs);
const opts = { const opts = {
session: {
synthesizer: this.data.synthesizer || { synthesizer: this.data.synthesizer || {
vendor: 'default', vendor: 'default',
language: 'default', language: 'default',
@@ -113,7 +112,6 @@ class Cognigy extends Task {
bot: this.data.bot || {}, bot: this.data.bot || {},
user: this.data.user || {}, user: this.data.user || {},
dtmf: this.data.dtmf || {} dtmf: this.data.dtmf || {}
}
}; };
this.config = new SpeechConfig({logger: this.logger, ep, opts}); this.config = new SpeechConfig({logger: this.logger, ep, opts});
this.ep = ep; this.ep = ep;

View File

@@ -7,9 +7,6 @@ const stripNulls = (obj) => {
return obj; return obj;
}; };
const defaultSpeechConfig
class SpeechConfig extends Emitter { class SpeechConfig extends Emitter {
constructor({logger, ep, opts = {}}) { constructor({logger, ep, opts = {}}) {
super(); super();

View File

@@ -318,7 +318,9 @@ class TaskGather extends Task {
} }
if (evt.is_final) this._resolve('speech', evt); if (evt.is_final) this._resolve('speech', evt);
else { else {
if (evt.stability > 0.70 && this.bargein && evt.alternatives[0].transcript.split(' ').length >= this.minBargeinWordCount) { if (evt.stability > 0.70 &&
this.bargein &&
evt.alternatives[0].transcript.split(' ').length >= this.minBargeinWordCount) {
this.logger.debug('Gather:_onTranscription - killing audio due to bargein'); this.logger.debug('Gather:_onTranscription - killing audio due to bargein');
this._killAudio(cs); this._killAudio(cs);
this._resolve('speech', evt); this._resolve('speech', evt);