style: fix formatter issues
This commit is contained in:
parent
75e314f6b0
commit
e7fdf9716c
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user