Skip to content

yetone/baidu_tts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

baidu_tts

A Python lib of Baidu TTS.

Installation

$ pip install baidu_tts

Usage

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

About

A Python lib of Baidu TTS.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages