nohzafk / tetos

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TeToS

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

Supported TTS providers

  • Edge-TTS

  • OpenAI TTS

    Required parameters:

    • api_key: OpenAI API key
  • Azure TTS

    Required parameters(Please refer to the documentation to get the secrets):

    • speech_key: Azure Speech service key
    • service_region: Azure Speech service region
  • Volcengine TTS(火山引擎)

    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

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.

API Usage

Use Azure TTS as an example:

import anyio

from pathlib import Path
from tetos.azure import AzureSpeaker

speaker = AzureSpeaker(speech_key='...', speech_region='...')
anyio.run(speaker.synthesize, 'Hello, world!', Path('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

Apache License 2.0

About

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

License:Other


Languages

Language:Python 100.0%