From ca17273b938700358994657d2529f1f7108d874b Mon Sep 17 00:00:00 2001 From: Hiago Silva <97215740+Huntterxx@users.noreply.github.com> Date: Sun, 15 Mar 2026 13:03:18 -0300 Subject: [PATCH] fix: no-op for empty text to preserve existing behavior --- src/tts/tts-core.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tts/tts-core.ts b/src/tts/tts-core.ts index fd7a8c861c3..d8aff2d3694 100644 --- a/src/tts/tts-core.ts +++ b/src/tts/tts-core.ts @@ -704,9 +704,8 @@ export async function edgeTTS(params: { }): Promise { const { text, outputPath, config, timeoutMs } = params; - if (!text || text.trim().length === 0) { - return; - } + const safeText = + text && text.trim().length > 0 ? text : " "; const tts = new EdgeTTS({ voice: config.voice, @@ -720,12 +719,12 @@ export async function edgeTTS(params: { timeout: config.timeoutMs ?? timeoutMs, }); - await tts.ttsPromise(text, outputPath); + await tts.ttsPromise(safeText, outputPath); let { size } = statSync(outputPath); if (size === 0) { - await tts.ttsPromise(text, outputPath); + await tts.ttsPromise(safeText, outputPath); ({ size } = statSync(outputPath)); if (size === 0) {