From f858ccb7812e3d4ea0adb254dfd2f859868383c4 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 8 Feb 2024 14:55:39 -0500 Subject: [PATCH] for tts streaming we need to replace CR and LF with spaces, as we can not send text with those characters to freeswitch currently --- lib/synth-audio.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/synth-audio.js b/lib/synth-audio.js index 101a8c4..9963967 100644 --- a/lib/synth-audio.js +++ b/lib/synth-audio.js @@ -625,7 +625,7 @@ const synthElevenlabs = async(logger, {credentials, options, stats, language, vo params += '}'; return { - filePath: `say:${params}${text.replace(/\n/g, ' ')}`, + filePath: `say:${params}${text.replace(/\n/g, ' ').replace(/\r/g, ' ')}`, servedFromCache: false, rtt: 0 };