mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-22 01:27:55 +00:00
bugfix: vad was not enabled on config verb, restart STT on empty transcript in gather
This commit is contained in:
@@ -236,7 +236,6 @@ class CallSession extends Emitter {
|
|||||||
|
|
||||||
async enableBotMode(gather, autoEnable) {
|
async enableBotMode(gather, autoEnable) {
|
||||||
try {
|
try {
|
||||||
gather.timeout = 0; // background gathers should not timeout
|
|
||||||
const t = normalizeJambones(this.logger, [gather]);
|
const t = normalizeJambones(this.logger, [gather]);
|
||||||
this.backgroundGatherTask = makeTask(this.logger, t[0]);
|
this.backgroundGatherTask = makeTask(this.logger, t[0]);
|
||||||
this.backgroundGatherTask
|
this.backgroundGatherTask
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class TaskConfig extends Task {
|
|||||||
cs.speechRecognizerLanguage = this.recognizer.language !== 'default'
|
cs.speechRecognizerLanguage = this.recognizer.language !== 'default'
|
||||||
? this.recognizer.language
|
? this.recognizer.language
|
||||||
: cs.speechRecognizerLanguage;
|
: cs.speechRecognizerLanguage;
|
||||||
|
this.gatherOpts.recognizer = this.recognizer;
|
||||||
this.logger.info({recognizer: this.recognizer}, 'Config: updated recognizer');
|
this.logger.info({recognizer: this.recognizer}, 'Config: updated recognizer');
|
||||||
}
|
}
|
||||||
if (this.hasBargeIn) {
|
if (this.hasBargeIn) {
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ class TaskGather extends Task {
|
|||||||
if (this.profanityOption && this.profanityOption !== 'raw') opts.AZURE_PROFANITY_OPTION = this.profanityOption;
|
if (this.profanityOption && this.profanityOption !== 'raw') opts.AZURE_PROFANITY_OPTION = this.profanityOption;
|
||||||
if (this.azureServiceEndpoint) opts.AZURE_SERVICE_ENDPOINT = this.azureServiceEndpoint;
|
if (this.azureServiceEndpoint) opts.AZURE_SERVICE_ENDPOINT = this.azureServiceEndpoint;
|
||||||
if (this.initialSpeechTimeoutMs > 0) opts.AZURE_INITIAL_SPEECH_TIMEOUT_MS = this.initialSpeechTimeoutMs;
|
if (this.initialSpeechTimeoutMs > 0) opts.AZURE_INITIAL_SPEECH_TIMEOUT_MS = this.initialSpeechTimeoutMs;
|
||||||
|
else if (this.timeout === 0) opts.AZURE_INITIAL_SPEECH_TIMEOUT_MS = 120000; // lengthy
|
||||||
opts.AZURE_USE_OUTPUT_FORMAT_DETAILED = 1;
|
opts.AZURE_USE_OUTPUT_FORMAT_DETAILED = 1;
|
||||||
|
|
||||||
ep.addCustomEventListener(AzureTranscriptionEvents.Transcription, this._onTranscription.bind(this, cs, ep));
|
ep.addCustomEventListener(AzureTranscriptionEvents.Transcription, this._onTranscription.bind(this, cs, ep));
|
||||||
@@ -382,7 +383,13 @@ class TaskGather extends Task {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (evt.is_final) this._resolve('speech', evt);
|
if (evt.is_final) {
|
||||||
|
if (evt.alternatives[0].transcript === '') {
|
||||||
|
this.logger.info({evt}, 'TaskGather:_onTranscription - got empty transcript, listen again');
|
||||||
|
this._startTranscribing(ep);
|
||||||
|
}
|
||||||
|
this._resolve('speech', evt);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* google has a measure of stability:
|
/* google has a measure of stability:
|
||||||
https://cloud.google.com/speech-to-text/docs/basics#streaming_responses
|
https://cloud.google.com/speech-to-text/docs/basics#streaming_responses
|
||||||
|
|||||||
Reference in New Issue
Block a user