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;
|
executedLanguage = language;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
let isFallbackSuccess = false;
|
||||||
if (fallbackVendor) {
|
if (fallbackVendor) {
|
||||||
const fallbackcredentials = cs.getSpeechCredentials(fallbackVendor, 'tts', fallbackLabel);
|
const fallbackcredentials = cs.getSpeechCredentials(fallbackVendor, 'tts', fallbackLabel);
|
||||||
const {span: fallbackSpan} = this.startChildSpan('fallback-tts-generation', {
|
const {span: fallbackSpan} = this.startChildSpan('fallback-tts-generation', {
|
||||||
@@ -184,6 +185,7 @@ class TaskSay extends Task {
|
|||||||
credentials: fallbackcredentials,
|
credentials: fallbackcredentials,
|
||||||
disableTtsCache : this.disableTtsCache
|
disableTtsCache : this.disableTtsCache
|
||||||
});
|
});
|
||||||
|
isFallbackSuccess = true;
|
||||||
|
|
||||||
fallbackSpan.setAttributes({'tts.cached': servedFromCache});
|
fallbackSpan.setAttributes({'tts.cached': servedFromCache});
|
||||||
fallbackSpan.end();
|
fallbackSpan.end();
|
||||||
@@ -211,7 +213,7 @@ class TaskSay extends Task {
|
|||||||
}).catch((err) => this.logger.info({err}, 'Error generating alert for fallback tts failure'));
|
}).catch((err) => this.logger.info({err}, 'Error generating alert for fallback tts failure'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!isFallbackSuccess) {
|
||||||
this.logger.info({error}, 'Error synthesizing tts');
|
this.logger.info({error}, 'Error synthesizing tts');
|
||||||
span.end();
|
span.end();
|
||||||
writeAlerts({
|
writeAlerts({
|
||||||
@@ -223,6 +225,7 @@ class TaskSay extends Task {
|
|||||||
this.notifyError({msg: 'TTS error', details: error.message || error});
|
this.notifyError({msg: 'TTS error', details: error.message || error});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.debug(`file ${filePathUrl}, served from cache ${isFromCache}`);
|
this.logger.debug(`file ${filePathUrl}, served from cache ${isFromCache}`);
|
||||||
if (filePathUrl) cs.trackTmpFile(filePathUrl);
|
if (filePathUrl) cs.trackTmpFile(filePathUrl);
|
||||||
|
|||||||
Reference in New Issue
Block a user