mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 09:08:02 +00:00
wip
This commit is contained in:
@@ -163,6 +163,7 @@ class TaskSay extends Task {
|
||||
executedLanguage = language;
|
||||
|
||||
} catch (error) {
|
||||
let isFallbackSuccess = false;
|
||||
if (fallbackVendor) {
|
||||
const fallbackcredentials = cs.getSpeechCredentials(fallbackVendor, 'tts', fallbackLabel);
|
||||
const {span: fallbackSpan} = this.startChildSpan('fallback-tts-generation', {
|
||||
@@ -184,6 +185,7 @@ class TaskSay extends Task {
|
||||
credentials: fallbackcredentials,
|
||||
disableTtsCache : this.disableTtsCache
|
||||
});
|
||||
isFallbackSuccess = true;
|
||||
|
||||
fallbackSpan.setAttributes({'tts.cached': servedFromCache});
|
||||
fallbackSpan.end();
|
||||
@@ -211,7 +213,7 @@ class TaskSay extends Task {
|
||||
}).catch((err) => this.logger.info({err}, 'Error generating alert for fallback tts failure'));
|
||||
}
|
||||
}
|
||||
|
||||
if (!isFallbackSuccess) {
|
||||
this.logger.info({error}, 'Error synthesizing tts');
|
||||
span.end();
|
||||
writeAlerts({
|
||||
@@ -223,6 +225,7 @@ class TaskSay extends Task {
|
||||
this.notifyError({msg: 'TTS error', details: error.message || error});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.logger.debug(`file ${filePathUrl}, served from cache ${isFromCache}`);
|
||||
if (filePathUrl) cs.trackTmpFile(filePathUrl);
|
||||
|
||||
Reference in New Issue
Block a user