Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,25 @@ Remember that most TTS services require credentials to work and thus you must br

```bash
POLLY_REGION=
POLLY_AWS_ID=
POLLY_AWS_KEY=
POLLY_AWS_KEY_ID=
POLLY_AWS_ACCESS_KEY=

MICROSOFT_KEY=
MICROSOFT_TOKEN=
MICROSOFT_REGION=

GOOGLE_SA_PATH=.secrets/google.json
GOOGLE_SA_FILE_B64=

WATSON_API_KEY=
WATSON_API_URL=
WATSON_REGION=
WATSON_INSTANCE_ID=

ELEVENLABS_API_KEY=
WITAI_TOKEN=
PLAYHT_API_KEY=
PLAYHT_USER_ID=
UPLIFTAI_KEY=
MODELSLAB_API_KEY=
```

For PicoTTS you also need to install the package for your system. Check the documentation for how to do that.
Expand All @@ -148,7 +158,7 @@ You don't actually need to run tests for all services if you don't want to. Sinc

```Python
source .secrets/.env && \
export POLLY_REGION POLLY_AWS_ID POLLY_AWS_KEY && \
export POLLY_REGION POLLY_AWS_KEY_ID POLLY_AWS_ACCESS_KEY && \
pytest tests/engines/test_polly.py
```

Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ _TTS-Wrapper_ simplifies using text-to-speech APIs by providing a unified interf
- eSpeak-NG
- Play.HT
- UpliftAI
- ModelsLab
- OpenAI
- AVSynth (macOS only)
- SAPI (Windows only)
Expand Down Expand Up @@ -63,6 +64,7 @@ _TTS-Wrapper_ simplifies using text-to-speech APIs by providing a unified interf
| ElevenLabs | Linux/MacOS/Windows| Online | No* | Yes | Yes | Yes | Full |
| Play.HT | Linux/MacOS/Windows| Online | No* | No** | Yes | Yes | Basic |
| UpliftAI | Linux/MacOS/Windows| Online | No* | No** | Yes | Yes | Basic |
| ModelsLab | Linux/MacOS/Windows| Online | No* | No** | Yes | Yes | Basic |
| OpenAI | Linux/MacOS/Windows| Online | No | No | Yes | Yes | Basic |
| Wit.Ai | Linux/MacOS/Windows| Online | No* | No** | Yes | Yes | Basic |
| eSpeak | Linux/MacOS | Offline | Yes | No** | Yes | Yes | Basic |
Expand Down Expand Up @@ -271,6 +273,13 @@ from tts_wrapper import UpliftAIClient
client = UpliftAIClient(api_key="api_key")
```

#### ModelsLab

```python
from tts_wrapper import ModelsLabClient
client = ModelsLabClient(api_key="your_modelslab_api_key")
```

#### UWP

```python
Expand Down Expand Up @@ -930,6 +939,9 @@ Example structure (do NOT commit actual credentials):
"Microsoft": {
"token": "your-subscription-key",
"region": "your-region"
},
"ModelsLab": {
"api_key": "your-modelslab-api-key"
}
}
```
Expand Down Expand Up @@ -971,6 +983,11 @@ Example structure (do NOT commit actual credentials):
- [Create a new app and get token](https://wit.ai/docs/quickstart)
- [Wit.ai Documentation](https://wit.ai/docs)

#### ModelsLab
- [Create a ModelsLab account](https://modelslab.com/)
- [Get your API key](https://docs.modelslab.com/)
- [ModelsLab TTS Documentation](https://docs.modelslab.com/voice-cloning/text-to-speech)

## License

This project is licensed under the [MIT License](./LICENSE).
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
]
license = "MIT"
readme = "README.md"
keywords = ["tts", "text-to-speech", "speech synthesis", "polly", "sapi", "mms", "gTTS", "witai", "elevenlabs", "playht", "upliftai", "sherpaonnx"]
keywords = ["tts", "text-to-speech", "speech synthesis", "polly", "sapi", "mms", "gTTS", "witai", "elevenlabs", "playht", "upliftai", "sherpaonnx", "modelslab"]
requires-python = ">=3.10,<3.14"

dependencies = [
Expand Down Expand Up @@ -47,6 +47,7 @@ sherpaonnx = [
"sherpa-onnx>=1.10.17,<1.11.7",
] # Pin to 1.11.x for better Windows wheel support across Python versions
playht = [] # No additional dependencies needed as we use requests which is in core dependencies
modelslab = [] # No additional dependencies needed as we use requests which is in core dependencies
googletrans = ["gTTS>=2.5.2"]
mp3 = [
"pymp3>=0.2.0; python_version < '3.13'",
Expand Down
6 changes: 6 additions & 0 deletions tests/test_tts_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
GoogleClient,
GoogleTransClient,
MicrosoftClient,
ModelsLabClient,
OpenAIClient,
PlayHTClient,
PollyClient,
Expand Down Expand Up @@ -39,6 +40,7 @@
"playht": PlayHTClient,
"openai": OpenAIClient,
"upliftai": UpliftAIClient,
"modelslab": ModelsLabClient,
}

# Add AVSynth only on macOS
Expand Down Expand Up @@ -146,6 +148,8 @@ def check_credentials(service):
client = AVSynthClient()
elif service == "openai":
client = OpenAIClient(api_key=os.getenv("OPENAI_API_KEY"))
elif service == "modelslab":
client = ModelsLabClient(api_key=os.getenv("MODELSLAB_API_KEY"))
else:
# Unknown service or not available on this platform
VALID_CREDENTIALS[service] = False
Expand Down Expand Up @@ -209,6 +213,8 @@ def create_tts_client(service):
return AVSynthClient()
if service == "openai":
return OpenAIClient(api_key=os.getenv("OPENAI_API_KEY"))
if service == "modelslab":
return ModelsLabClient(api_key=os.getenv("MODELSLAB_API_KEY"))
msg = f"Unknown service or not available on this platform: {service}"
raise ValueError(msg)

Expand Down
1 change: 1 addition & 0 deletions tts_wrapper/engines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .elevenlabs import *
from .espeak import *
from .google import *
from .modelslab import *
from .googletrans import *
from .microsoft import *
from .openai import *
Expand Down
5 changes: 5 additions & 0 deletions tts_wrapper/engines/modelslab/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""ModelsLab TTS engine for tts-wrapper."""

from .client import ModelsLabClient

__all__ = ["ModelsLabClient"]
Loading
Loading