This commit is contained in:
Quan HL
2023-08-17 17:04:38 +07:00
parent 541cb1458d
commit a97d99650c

View File

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