重构了translator,写了点数据库、后端api路由
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
2025-11-10 21:40:25 +08:00
parent b30f9fb0c3
commit 3db1b3716f
51 changed files with 1029 additions and 432 deletions

16
src/lib/tts.ts Normal file
View File

@@ -0,0 +1,16 @@
import { ProsodyOptions } from "edge-tts-universal";
import { EdgeTTS } from "edge-tts-universal/browser";
export async function getTTSAudioUrl(
text: string,
short_name: string,
options: ProsodyOptions | undefined = undefined,
) {
const tts = new EdgeTTS(text, short_name, options);
try {
const result = await tts.synthesize();
return URL.createObjectURL(result.audio);
} catch (e) {
throw e;
}
}