An open API service indexing awesome lists of open source software.

https://github.com/marcus67/python_google_speak

Python module that uses a Google Translate online web service to convert short texts into high quality MP3 tracks
https://github.com/marcus67/python_google_speak

Last synced: about 1 year ago
JSON representation

Python module that uses a Google Translate online web service to convert short texts into high quality MP3 tracks

Awesome Lists containing this project

README

          

# python_google_speak
This is a little Python module that uses a Google Translate online web service to convert short
texts into high quality MP3 tracks.

## Source Repository ##

See https://github.com/marcus67/python_google_speak

## CircleCI Continuous Integration Status

## GitHub Status


## Sample Usage ##


from python_google_speak import speech_generator
from python_google_speak import speech_output

sound_generator = speech_generator.SpeechGenerator(p_locale="en_US")
sound_data = sound_generator.generate_audio_data("hello.")
speech_output.playback_audio_data(sound_data)

## Caveats ##
* Google limits the length of the text to a few hundred characters.
* The library `playsound` which is used by `speech_output` has issues when called from within
a virtual environment.

## Command Line Interface

The tool can be called from the command line as follows:


# To output to the standard audio device:
> google_speak --locale "en_US" "hello!"

# To write audio data to a file
> google_speak --locale "en_US" --outfile "hello.mp3" "hello!"