Unified interface for multiple Text-to-Speech (TTS) providers
Project description
TeToS
A unified interface for multiple Text-to-Speech (TTS) providers.
Supported TTS providers
-
Required parameters:
api_key
: OpenAI API key
-
Required parameters(Please refer to the documentation to get the secrets):
speech_key
: Azure Speech service keyspeech_region
: Azure Speech service region
-
Requirements:
- Enable the Text-to-Speech API in the Google Cloud Console
- Environment variables
GOOGLE_APPLICATION_CREDENTIALS
pointing to the service account key file
-
Required parameters:
access_key
: Volcengine access key ID. (Get it here)secret_key
: Volcengine access secret key. (Get it here)app_key
: Volcengine app key
-
Required parameters:
api_key
: Baidu API keysecret_key
: Baidu secret key
-
Required parameters:
api_key
: Minimax API keygroup_id
: Minimax group ID
Get both at the Minimax console
Installation
Requires Python 3.8 or higher.
pip install tetos
CLI Usage
tetos PROVIDER [PROVIDER_OPTIONS] TEXT [--output FILE]
Please run tetos --help
for available providers and options.
Examples
tetos google "Hello, world!"
tetos azure "Hello, world!" --output output.mp3 # save to another file
tetos edge --lang zh-CN "你好,世界!" # specify language
tetos openai --voice echo "Hello, world!" # specify voice
API Usage
Use Azure TTS as an example:
from tetos.azure import AzureSpeaker
speaker = AzureSpeaker(speech_key='...', speech_region='...')
speaker.say('Hello, world!', 'output.mp3')
The initialization parameters may be different for other providers.
Behind a proxy
TeTos respects the proxy environment variables HTTP_PROXY
, HTTPS_PROXY
, ALL_PROXY
and NO_PROXY
.
TODO
- Google TTS
- SSML support
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tetos-0.2.1.tar.gz
(20.2 kB
view hashes)
Built Distribution
tetos-0.2.1-py3-none-any.whl
(23.1 kB
view hashes)