Skip to content

scalabli/t2s

Repository files navigation

t2s

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.

http://t2s.readthedocs.org/

PyPI version Python versions Tests workflow Commits Since PyPi Downloads Buy me a Coffee

Features

  • 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;

Installation

$ pip install t2s

Quickstart

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.

Project