mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
update to latest realtimedb-helpers
This commit is contained in:
@@ -214,27 +214,27 @@ class Dialogflow extends Task {
|
||||
salt: cs.callSid
|
||||
};
|
||||
this.logger.debug({obj}, 'Dialogflow:_onIntent - playing message via tts');
|
||||
const fp = await synthAudio(obj);
|
||||
if (fp) cs.trackTmpFile(fp);
|
||||
const {filepath} = await synthAudio(obj);
|
||||
if (filepath) cs.trackTmpFile(filepath);
|
||||
|
||||
if (this.playInProgress) {
|
||||
await ep.api('uuid_break', ep.uuid).catch((err) => this.logger.info(err, 'Error killing audio'));
|
||||
}
|
||||
this.playInProgress = true;
|
||||
this.curentAudioFile = fp;
|
||||
this.curentAudioFile = filepath;
|
||||
|
||||
this.logger.debug(`starting to play tts ${fp}`);
|
||||
this.logger.debug(`starting to play tts ${filepath}`);
|
||||
|
||||
if (this.events.includes('start-play')) {
|
||||
this._performHook(cs, this.eventHook, {event: 'start-play', data: {path: fp}});
|
||||
this._performHook(cs, this.eventHook, {event: 'start-play', data: {path: filepath}});
|
||||
}
|
||||
await ep.play(fp);
|
||||
await ep.play(filepath);
|
||||
if (this.events.includes('stop-play')) {
|
||||
this._performHook(cs, this.eventHook, {event: 'stop-play', data: {path: fp}});
|
||||
this._performHook(cs, this.eventHook, {event: 'stop-play', data: {path: filepath}});
|
||||
}
|
||||
this.logger.debug(`finished ${fp}`);
|
||||
this.logger.debug(`finished ${filepath}`);
|
||||
|
||||
if (this.curentAudioFile === fp) {
|
||||
if (this.curentAudioFile === filepath) {
|
||||
this.playInProgress = false;
|
||||
if (this.queuedTasks) {
|
||||
this.logger.debug('finished playing audio and we have queued tasks');
|
||||
|
||||
@@ -184,20 +184,20 @@ class Lex extends Task {
|
||||
|
||||
try {
|
||||
this.logger.debug(`tts with ${this.vendor} ${this.voice}`);
|
||||
const fp = await synthAudio({
|
||||
const {filepath} = await synthAudio({
|
||||
text: msg,
|
||||
vendor: this.vendor,
|
||||
language: this.language,
|
||||
voice: this.voice,
|
||||
salt: cs.callSid
|
||||
});
|
||||
if (fp) cs.trackTmpFile(fp);
|
||||
if (filepath) cs.trackTmpFile(filepath);
|
||||
if (this.events.includes('start-play')) {
|
||||
this._performHook(cs, this.eventHook, {event: 'start-play', data: {path: fp}});
|
||||
this._performHook(cs, this.eventHook, {event: 'start-play', data: {path: filepath}});
|
||||
}
|
||||
await ep.play(fp);
|
||||
await ep.play(filepath);
|
||||
if (this.events.includes('stop-play')) {
|
||||
this._performHook(cs, this.eventHook, {event: 'stop-play', data: {path: fp}});
|
||||
this._performHook(cs, this.eventHook, {event: 'stop-play', data: {path: filepath}});
|
||||
}
|
||||
this.logger.debug(`finished tts, sending play_done ${this.vendor} ${this.voice}`);
|
||||
this.ep.api('aws_lex_play_done', this.ep.uuid)
|
||||
|
||||
Reference in New Issue
Block a user