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

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