Skip to content

Natural sounding text-to-speech in the terminal (and more).

License

Notifications You must be signed in to change notification settings

Samyak2/gosling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gosling

Natural sounding text-to-speech in the terminal (and more).

Pre-requisites

This is NOT intended to be a completely-free, pick-up-and-use TTS solution. In fact, it is simply a wrapper around Google's Cloud Text-to-Speech API.

You will need:

  • A GCP account with billing enabled.
    • Google gives you 1 million characters free every month. That's nearly 10 books a month. It's essentially free for personal use.
    • Once you have a GCP account, enable the TTS API and get a service account.
    • Export service account credentials in your shell. You will need to do this every time you open a new shell. Add it to your shell configuration or make a script to run gosling for convenience.
      export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account.json"
  • Internet connection every time you need some text spoken to you.
  • I have only tested this on Linux. Commands for playing audio will be different on other platforms.

Examples

Simple text with default options

defaults.mp4

Numbers and punctuation with default options

(the multiple exclamations are something that I have seen other TTSs struggle with):

Welcome to gosling!!! It has options such as "Pitch adjustment" in the range -20.0 to 20.0, "Speaking rate/speed" in the range 0.25 to 4.0 and "Volume gain" (in dB) in the range -96.0 to 16.0.
numbers_punc.mp4

Other languages

Kannada:

kannada.mp4