Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wengchaoxi/tts-api
Azure TTS API Service
https://github.com/wengchaoxi/tts-api
azure docker docker-compose flask python tts
Last synced: 22 days ago
JSON representation
Azure TTS API Service
- Host: GitHub
- URL: https://github.com/wengchaoxi/tts-api
- Owner: wengchaoxi
- License: mit
- Created: 2024-01-19T03:48:35.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-19T07:04:52.000Z (10 months ago)
- Last Synced: 2024-03-10T07:25:41.144Z (8 months ago)
- Topics: azure, docker, docker-compose, flask, python, tts
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tts-api
TTS API Service
## Azure TTS
Rename `.env.example` to `.env` and fill in `AZURE_SPEECH_KEY`
```bash
docker compose build && docker compose up
``````python
import requests, base64, jsontext = "你好,世界"
voice_name = 'zh-CN-XiaoxiaoNeural'tmp = requests.post('http://localhost:9000/v1/azure/', data={'text': text, 'voice_name': voice_name})
res = json.loads(tmp.text)b64_data = res.get('data')
cost = res.get('cost')file_name = 'result-%.3lfs.wav' % cost
with open(file_name, 'wb') as f:
f.write(base64.b64decode(b64_data))
```