Skip to content

Translate text to speech using Google Cloud on the command line

License

Notifications You must be signed in to change notification settings

NullEnt1ty/GoCloudTTS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoCloudTTS

Translate text to speech using Google Cloud on the command line.

Installation

You can find prebuilt binaries under releases. Download the binary for your system and you're good to go.

Usage

Make sure to provide your Google Cloud credentials by setting the environment variable GOOGLE_APPLICATION_CREDENTIALS as described on this page.

$ GoCloudTTS --help

Usage: GoCloudTTS [OPTIONS] text

OPTIONS:

  -cache-dir string
        set the cache directory for voice files (default "/tmp/gocloudtts/cache")
  -language string
        set the language code of the input text (default "en-US")
  -voice-name string
        set the name of the voice which should be used (default "en-US-Standard-C")

You can find a list of supported languages and voices here.

Example

The following command will translate the text "Peter Piper picked a peck of pickled peppers" and play it through aplay.

$ GoCloudTTS "Peter Piper picked a peck of pickled peppers" | aplay

To change the language use the parameters -language and -voice-name.

$ GoCloudTTS -language ja-JP -voice-name ja-JP-Standard-A "おまえ わ もう しんでいる! なに?!"