Spaces:
Sleeping
Sleeping
Download src/libs/tts.py from easyreadtogether/easyreadDemo: direct link, hf CLI and curl.
- Browser
- Download file 562 Bytes
-
https://huggingface.co/spaces/easyreadtogether/easyreadDemo/resolve/main/src/libs/tts.py
- Command line
-
hf download hf://spaces/easyreadtogether/easyreadDemo/src/libs/tts.py
-
curl -L -o tts.py https://huggingface.co/spaces/easyreadtogether/easyreadDemo/resolve/main/src/libs/tts.py
562 Bytes
| # Abstract Base Class For Text-to-Speech (TTS) Engines | |
| from abc import ABC, abstractmethod | |
| class BaseTTS(ABC): | |
| def __init__(self, config): | |
| pass | |
| def synthesize_one(self, text) -> bytes | str: | |
| # Synthesize a single text input and return the audio data (e.g., as bytes or a file path) | |
| pass | |
| def synthesize_batch(self, texts) -> list[bytes | str]: | |
| # Synthesize a batch of text inputs and return a list of audio data (e.g., as bytes or file paths) | |
| pass |