error handling for TTS synthesize
This commit is contained in:
parent
2de60a98a3
commit
37fddca3e4
1 changed files with 6 additions and 2 deletions
|
@ -92,8 +92,12 @@ export class MSAgentChatRoom {
|
|||
}
|
||||
};
|
||||
if (this.tts !== null) {
|
||||
try {
|
||||
let filename = await this.tts.synthesizeToFile(message, (++this.msgId).toString(10));
|
||||
msg.data.audio = '/api/tts/' + filename;
|
||||
} catch (e) {
|
||||
console.error(`Error synthesizing TTS: ${(e as Error).message}`);
|
||||
}
|
||||
}
|
||||
for (const _client of this.getActiveClients()) {
|
||||
_client.send(msg);
|
||||
|
|
Loading…
Reference in a new issue