https://github.com/yetone/baidu_tts
A Python lib of Baidu TTS.
https://github.com/yetone/baidu_tts
Last synced: 8 months ago
JSON representation
A Python lib of Baidu TTS.
- Host: GitHub
- URL: https://github.com/yetone/baidu_tts
- Owner: yetone
- Created: 2016-09-13T06:03:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-29T02:44:58.000Z (over 9 years ago)
- Last Synced: 2025-02-08T03:46:16.634Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# baidu_tts
A Python lib of Baidu TTS.
## Installation
$ pip install baidu_tts
## Usage
```python
from baidu_tts import BaiduTTS
tts = BaiduTTS(YOUR_API_KEY, YOUR_SECRET_KEY)
sound_buffer = tts.say('你好') # get sound buffer
sound_buffer.write('/tmp/hello.mp3') # save to file
content = sound_buffer.read() # get binary content
stream = sound_buffer.stream # get binary stream
# iter content
for chunk in sound_buffer.iter_content(chunk_size=1024):
if chunk:
...
```
## License
MIT