Files
HeurAMS/src/heurams/providers/tts/edge_tts.py
2025-11-02 03:15:18 +08:00

15 lines
378 B
Python

from .base import BaseTTS
import pathlib
import edge_tts
class EdgeTTS(BaseTTS):
name = "EdgeTTS"
@classmethod
def convert(cls, text, path: pathlib.Path | str = "") -> pathlib.Path:
communicate = edge_tts.Communicate(
text,
"zh-CN-YunjianNeural",
)
communicate.save_sync(str(path))
return path # type: ignore