Skip to content
/ tts Public

CLI tool to convert text to speech using the StreamLabs API

License

Notifications You must be signed in to change notification settings

purarue/tts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project Status

This was always using an undocumented API, seems that the underlying APIs have changed so this no longer works. The endpoint used to be at https://streamlabs.com/polly/speak, if anyone knows if there's an updated URL feel free to open an issue.

tts

A CLI tool to interact with the StreamLabs Text-To-Speech API endpoint.

Usage

Usage:  tts [-h] [-v VOICE] [-d FILENAME|-p] <text_to_speak>...
Converts text to speech using the StreamLabs API
Any other positional arguments are interpreted as the text input
If no text is present, reads from STDIN

   -h           Prints this help message and exits
   -v VOICE     Change the voice used for TTS
   -l           List available voices
   -d FILENAME  Download the .mpeg file to FILENAME.mpeg [default]
   -p           Instead of downloading, print the audio URL

Disclaimer: Not affiliated with or endorsed by StreamLabs

Install

After installing curl and jq;

Download the tts script somewhere onto your $PATH

wget -P ~/.local/bin 'https://raw.githubusercontent.com/purarue/tts/master/tts' && chmod +x ~/.local/bin/tts

Could also use basher:

basher install purarue/tts

Examples

tts -l  # to list voices

# basic examples
echo "hello mr streamer" | tts
tts 'O, o. .O, o.'
tts -v Emma 'what?'  # use a different voice

# save to filepath, and play after its downloaded. uses paplay, but mpv/vlc could also be used
echo 'Does this work? NO? .OK.' | tts -d /tmp/sound.mpeg && plaympeg /tmp/sound.mpeg

Audio: https://purarue.xyz/p/sound.mpeg

Notes

Converted to a nicer interface from the one liner found here.

Disclaimer: Not affiliated with or endorsed by StreamLabs

About

CLI tool to convert text to speech using the StreamLabs API

Topics

Resources

License

Stars

Watchers

Forks

Languages