mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
update transcribe to support google v1p1beta1 and aws
This commit is contained in:
@@ -47,6 +47,7 @@ class Dialogflow extends Task {
|
||||
this.language = this.data.tts.language || 'default';
|
||||
this.voice = this.data.tts.voice || 'default';
|
||||
}
|
||||
this.bargein = this.data.bargein;
|
||||
}
|
||||
|
||||
get name() { return TaskName.Dialogflow; }
|
||||
@@ -266,7 +267,7 @@ class Dialogflow extends Task {
|
||||
* @param {*} ep - media server endpoint
|
||||
* @param {*} evt - event data
|
||||
*/
|
||||
_onTranscription(ep, cs, evt) {
|
||||
async _onTranscription(ep, cs, evt) {
|
||||
const transcription = new Transcription(this.logger, evt);
|
||||
|
||||
if (this.events.includes('transcription') && transcription.isFinal) {
|
||||
@@ -281,6 +282,13 @@ class Dialogflow extends Task {
|
||||
transcription.confidence > 0.8) {
|
||||
ep.play(this.data.thinkingSound).catch((err) => this.logger.info(err, 'Error playing typing sound'));
|
||||
}
|
||||
|
||||
// interrupt playback on speaking if bargein = true
|
||||
if (this.bargein && this.playInProgress) {
|
||||
this.logger.debug('terminating playback due to speech bargein');
|
||||
this.playInProgress = false;
|
||||
await ep.api('uuid_break', ep.uuid);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user