Skip to main content

TeToS

PyPI Python License Downloads Documentation Status

A unified interface for multiple Text-to-Speech (TTS) providers.

Supported TTS providers

Provider Requirements
Edge-TTS -
OpenAI TTS api_key: OpenAI API key
Azure TTS speech_key: Azure Speech service key
speech_region: Azure Speech service region
Google TTS Enable the Text-to-Speech API in the Google Cloud Console
Set env var GOOGLE_APPLICATION_CREDENTIALS as the path to the service account key file
Volcengine TTS(火山引擎) access_key: Volcengine access key ID. (Get it here)
secret_key: Volcengine access secret key. (Get it here)
app_key: Volcengine app key
Baidu TTS api_key: Baidu API key
secret_key: Baidu secret key
Both can be acquired at the console
Minimax TTS api_key: Minimax API key
group_id: Minimax group ID
Both can be acquired at the Minimax console
迅飞 TTS app_id: Xunfei APP ID
api_key: Xunfei API key
api_secret: Xunfei API secret
Fish Audio api_key: Fish Audio API key

Installation

Tetos 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.

Work behind a proxy

TeTos respects the proxy environment variables HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY.

TODO

  • Google TTS
  • SSML support

License

Apache License 2.0

Metadata

Release files for tetos 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tetos 0.3.1
File Size Uploaded
tetos-0.3.1.tar.gz 22.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tetos 0.3.1
File Interpreter ABI Platform
tetos-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 49.7 kB

Release files / tetos-0.3.1.tar.gz

Download URL tetos-0.3.1.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7be4fed5f3704a2789e302c7fd8486385455305cba3a86a83dec57a3e0d65b74
BLAKE2b-256 checksum
How to use checksums
547492ac7663ee514ae2852a6c421e5ad23e48e8a5a548c6d844b50b51193aea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.18.1.dev2+gfdfc2fb5.d20240815 CPython/3.11.9 Darwin/23.5.0

Release files / tetos-0.3.1-py3-none-any.whl

Download URL tetos-0.3.1-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d309bbad7e882779bc963b00b1677cfa59232b3d1b5b7eea49304212c50d7c35
BLAKE2b-256 checksum
How to use checksums
7b0a9ea123e9f1768763de587e46e29a23fc6a535d267e6db372889b19378e98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.18.1.dev2+gfdfc2fb5.d20240815 CPython/3.11.9 Darwin/23.5.0

Release history Release notifications | RSS feed

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page