tetos
0.4.1
多个文本到语音(TTS)提供商的统一界面。
提供者 | 要求 |
---|---|
边缘-TT | - |
Openai TTS | api_key :OpenAI API密钥 |
azure tts | speech_key :azure语音服务密钥speech_region :Azure语音服务区域 |
Google TTS | 在Google Cloud Console中启用文本到语音API 设置env env var GOOGLE_APPLICATION_CREDENTIALS 作为服务帐户密钥文件的路径 |
Volcengine TTS(火山引擎) | access_key :Volcengine Access密钥ID。 (在这里获取)secret_key :Volcengine访问Secret Key。 (在这里获取)app_key :volcengine应用程序密钥 |
百度TT | api_key :BAIDU API密钥secret_key :百度秘密钥匙两者都可以在控制台上获取 |
minimax tts | api_key :minimax api键group_id :minimax组ID两者都可以在minimax控制台上获取 |
tts | app_id :xunfei应用程序IDapi_key :XUNFEI API密钥api_secret :xunfei api秘密 |
鱼音频 | api_key :鱼音频API密钥 |
Tetos需要Python 3.8或更高。
pip install tetos
tetos PROVIDER [PROVIDER_OPTIONS] TEXT [--output FILE]
请运行tetos --help
。
例子
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
以Azure TTS为例:
from tetos . azure import AzureSpeaker
speaker = AzureSpeaker ( speech_key = '...' , speech_region = '...' )
speaker . say ( 'Hello, world!' , 'output.mp3' )
对于其他提供商,初始化参数可能不同。
TETO尊重代理环境变量HTTP_PROXY
, HTTPS_PROXY
, ALL_PROXY
和NO_PROXY
。
Apache许可证2.0