Natural sounding text-to-speech in the terminal (and more).
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.
defaults.mp4
(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
Kannada: