mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
bugfix: dep in bluebird was causing issue, update to latest synthAudio
This commit is contained in:
@@ -21,26 +21,26 @@ class TaskSay extends Task {
|
||||
this.ep = ep;
|
||||
try {
|
||||
// synthesize all of the text elements
|
||||
const filepath = (await Promise.all(this.text.map(async(text) => {
|
||||
const fp = await synthAudio({
|
||||
const files = (await Promise.all(this.text.map(async(text) => {
|
||||
const {filePath} = await synthAudio({
|
||||
text,
|
||||
vendor: this.synthesizer.vendor || cs.speechSynthesisVendor,
|
||||
language: this.synthesizer.language || cs.speechSynthesisLanguage,
|
||||
voice: this.synthesizer.voice || cs.speechSynthesisVoice,
|
||||
salt: cs.callSid
|
||||
}).catch((err) => this.logger.error(err, 'Error synthesizing text'));
|
||||
if (fp) cs.trackTmpFile(fp);
|
||||
return fp;
|
||||
if (filePath) cs.trackTmpFile(filePath);
|
||||
return filePath;
|
||||
})))
|
||||
.filter((fp) => fp && fp.length);
|
||||
|
||||
this.logger.debug({filepath}, 'synthesized files for tts');
|
||||
this.logger.debug({files}, 'synthesized files for tts');
|
||||
|
||||
while (!this.killed && this.loop-- && this.ep.connected) {
|
||||
let segment = 0;
|
||||
do {
|
||||
await ep.play(filepath[segment]);
|
||||
} while (!this.killed && ++segment < filepath.length);
|
||||
await ep.play(files[segment]);
|
||||
} while (!this.killed && ++segment < files.length);
|
||||
}
|
||||
} catch (err) {
|
||||
this.logger.info(err, 'TaskSay:exec error');
|
||||
|
||||
Reference in New Issue
Block a user