persistent connection for custom stt vendors in transcribe (#794)

This commit is contained in:
Dave Horton
2024-06-28 08:33:10 -04:00
committed by GitHub
parent 5e1b826da4
commit ec6d7b3f42

View File

@@ -429,9 +429,13 @@ class TaskTranscribe extends SttTask {
/* here is where we return a final transcript */ /* here is where we return a final transcript */
this.logger.debug({evt}, 'TaskTranscribe:_onTranscription - sending final transcript'); this.logger.debug({evt}, 'TaskTranscribe:_onTranscription - sending final transcript');
this._resolve(channel, evt); this._resolve(channel, evt);
/* some STT engines will keep listening after a final response, so no need to restart */ /* some STT engines will keep listening after a final response, so no need to restart */
if (!['soniox', 'aws', 'microsoft', 'deepgram', 'google'] if (!['soniox', 'aws', 'microsoft', 'deepgram', 'google'].includes(this.vendor) &&
.includes(this.vendor)) this._startTranscribing(cs, ep, channel); !this.vendor.startsWith('custom:')) {
this.logger.debug('TaskTranscribe:_onTranscription - restarting transcribe');
this._startTranscribing(cs, ep, channel);
}
} }
} }
else { else {