Some checks reported errors
continuous-integration/drone/push Build was killed
17 lines
425 B
TypeScript
17 lines
425 B
TypeScript
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;
|
|
}
|
|
}
|