style: fix formatting

This commit is contained in:
Hiago Silva 2026-03-15 15:10:07 -03:00 committed by GitHub
parent e7fdf9716c
commit 9c4b712d69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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