style: fix formatter issues

This commit is contained in:
Hiago Silva 2026-03-15 14:57:43 -03:00 committed by GitHub
parent 75e314f6b0
commit e7fdf9716c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -704,10 +704,6 @@ export async function edgeTTS(params: {
}): Promise<void> {
const { text, outputPath, config, timeoutMs } = params;
if (!text || text.trim().length === 0) {
throw new Error("TTS text cannot be empty");
}
const tts = new EdgeTTS({
voice: config.voice,
lang: config.lang,
@ -720,16 +716,18 @@ export async function edgeTTS(params: {
timeout: config.timeoutMs ?? timeoutMs,
});
await tts.ttsPromise(text, outputPath);
let { size } = statSync(outputPath);
if (size === 0) {
if (text && text.trim().length > 0) {
await tts.ttsPromise(text, outputPath);
({ size } = statSync(outputPath));
let { size } = statSync(outputPath);
if (size === 0) {
throw new Error("Edge TTS produced empty audio file after retry");
await tts.ttsPromise(text, outputPath);
({ size } = statSync(outputPath));
if (size === 0) {
throw new Error("Edge TTS produced empty audio file after retry");
}
}
}
}