update to latest realtimedb-helpers

This commit is contained in:
Dave Horton
2021-02-08 15:36:30 -05:00
parent 873729edb1
commit 0cff553310
4 changed files with 41 additions and 41 deletions

View File

@@ -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');