Skip to content

Instantly share code, notes, and snippets.

@voyeg3r
Created February 18, 2012 22:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save voyeg3r/1861156 to your computer and use it in GitHub Desktop.
Save voyeg3r/1861156 to your computer and use it in GitHub Desktop.
make your linux speech text from clipboard
#!/bin/bash
# Criado em: Sab 18/Fev/2012 hs 19:10
# Last Change: Sab 18/Fev/2012 hs 19:10
# vim:ft=sh:fdm=syntax:nu:
# Instituicao: <+nome+>
# Proposito do script: spech text from clipboard
# Autor: Sérgio Luiz Araújo Silva
# site: http://vivaotux.blogspot.com
# twitter: http://www.twitter.com/voyeg3r
# source: http://www.youtube.com/watch?v=4uKTamXonPs&feature=g-all-lik&context=G2707f4bFAAAAAAAAAAA
# Download: wget -c https://raw.github.com/gist/1861156 -O ~/bin/speechtext.sh && chmod +x $_
NEEDED_COMMANDS="festival xsel"
missing_counter=0
for needed_command in $NEEDED_COMMANDS; do
if ! hash "$needed_command" >/dev/null 2>&1; then
printf "Command not found in PATH: %s\n" "$needed_command" >&2
((missing_counter++))
fi
done
if ((missing_counter > 0)); then
printf "Minimum %d commands are missing in PATH, aborting" "$missing_counter" >&2
exit 1
fi
xsel | festival --tts --pipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment