t2s (Text-to-Speech), a Python library and CLI tool to interface with Google Translate's text-to-speech API.
Compose spoken mp3
or m4a
data to a file, a file-like object (bytestring) for further audio manipulation, or stdout
or simply pre-produce Google Translate Text to speech demand URLs to feed to an outside program.
- Customizable speech-specific sentence tokenizer that allows for unlimited lengths of text to be read, all while keeping proper intonation, abbreviations, decimals and more;
- Customizable text pre-processors which can, for example, provide pronunciation corrections;
$ pip install t2s
Command Line:
$ t2s-cli 'hello' --output hello.mp3
Module:
>>> from t2s import T2S
>>> tts = T2S('hello')
>>> tts.save('hello.mp3')
See http://t2s.readthedocs.org/ for documentation and examples.