Skip to main content

Unified interface for multiple Text-to-Speech (TTS) providers

Project description

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

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

Project details


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.3.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

tetos-0.3.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file tetos-0.3.0.tar.gz.

File metadata

  • Download URL: tetos-0.3.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.15.3 CPython/3.11.8 Darwin/23.4.0

File hashes

Hashes for tetos-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c6a5b0d711a27e6a1d6b24fb9ab59eb2a8250f0704c06eea2e031d95fa30798d
MD5 5bcc35dea380edceb6e0ffc9cd8c1ab7
BLAKE2b-256 59a5cdfe5dfb486a99faa269dd2ca917f908f2ff8d9d0904ebc10d5abeda8aa5

See more details on using hashes here.

Provenance

File details

Details for the file tetos-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: tetos-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.15.3 CPython/3.11.8 Darwin/23.4.0

File hashes

Hashes for tetos-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99a6564b947db32337533eb21e3be9e5043a3238716f72b05535641df3d22313
MD5 0ccb1dd39438ee4b91479b7fc774f0d3
BLAKE2b-256 6c7ec9a00670b51b7fedaf7a62ada36567bedb9e5ee1ca6baedeeb2400266931

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page