mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
google STT: default to command_and_search for Gather, as latest_short seems to have issues, various other fixes (#285)
This commit is contained in:
@@ -104,6 +104,10 @@ class TaskGather extends Task {
|
||||
|
||||
get needsStt() { return this.input.includes('speech'); }
|
||||
|
||||
get wantsMultipleUtterances() {
|
||||
return this.data.recognizer?.singleUtterance === false;
|
||||
}
|
||||
|
||||
get earlyMedia() {
|
||||
return (this.sayTask && this.sayTask.earlyMedia) ||
|
||||
(this.playTask && this.playTask.earlyMedia);
|
||||
@@ -661,14 +665,18 @@ class TaskGather extends Task {
|
||||
this._killAudio(cs);
|
||||
}
|
||||
|
||||
// DCH: commenting out because my experience is that the google STT engine
|
||||
// will keep listening after it detects end of utterance, and will return a final transcript
|
||||
// My earlier understanding that we needed to stop and restart the recognizer appears incorrect.
|
||||
/*
|
||||
if (!this.resolved && !this.killed && !this._bufferedTranscripts.length) {
|
||||
/**
|
||||
* By default, Gather asks google for a single utterance. On getting an end of utterance event,
|
||||
* the mod_google_transcribe plugin will send a WritesDone to the grpc stream, which will usually
|
||||
* cause google to return a final transcript. So even though we have not received a final
|
||||
* transcript at this point (because otherwise resolved() would be true), we do not need to
|
||||
* restart the recognizer - we should get the final transcript shortly.
|
||||
* The exception is if the Gather was specifically configured to listen
|
||||
* to multiple utterances, in which case we need to restart the recognizer.
|
||||
*/
|
||||
if (!this.resolved && !this.killed && !this._bufferedTranscripts.length && this.wantsMultipleUtterances) {
|
||||
this._startTranscribing(ep);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
_onStartOfSpeech(cs, ep) {
|
||||
|
||||
Reference in New Issue
Block a user