commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
EDIT: command updated to support accented characters!
Works in any of 58 google supported languages (some sound like crap, english is the best IMO).
You get a mp3 file containing your query in spoken language. There is a limit of 100 characters for the "q" parameter, so be careful. The "tl" parameter contains target language.
There are 8 alternatives - vote for the best!
Usage examples:
say hello
say "hello world"
say hello+world
same but redirecting to player and putting whaever text line.. works on my ubuntu machine ...
Sends a string to google tranlator, which converts it to English speech.
It's possible to create a nice script to do the job for us, such as
#!/bin'bash
curl -A "Mozilla" " /tmp/speak.mp3
mplayer /tmp/speak.mp3
If you can do better, submit your command here.
You must be signed in to comment.
Wow, I could spend all afternoon listening to my name in different European accents :-)
I tried this with Vietnamese, which I enter using unicode on a text editor and paste into the command line. However, I get nonsense back in the mp3 file. My command:
wget -q -U Mozilla -O output.mp3 "
It plays fine in the browser, which converts the URL:
http://translate.google.com/translate_tts?tl=vi&q=%C4%90o%C3%A0n
However, when I paste this url in the command line, I still get giberish:
wget -q -U Mozilla -O output.mp3 "
Any suggestions?
I can't seem to get it to work, too. I guess it is an issue with wget? http://savannah.gnu.org/bugs/index.php?20863
Maybe curl will work?
You could try piping the desired text into iconv to convert it to UTF-8 and only after that pipi the text into wget.
I tried piping to iconv: no go.
curl also doesn't work.
it works great, i change it to function
### usage: texttospeach en hello+world
texttospeach() {
wget -q -U Mozilla -O output.mp3 "
}
We now can play the sound live without the need to save the mp3 file before with a bash function ( a bash builtin replace all spaces by the + caracter ) :
say() { curl -s -A "Mozilla/5.0" "http://translate.google.com/translate_tts?tl=en&q=${@// /+}" | play -t mp3 -; }say "hello world"Note on the previous command : requires sox
I've written a small ash shell script which can handle text flowing from a pipe and also gives you a warning when you exceed the 100-character limit. http://saironiq.blogspot.com/2011/03/google-text-to-speech-api.html
I use wget with Google Translate to send sound to my Airport Express device: http://www.geekytidbits.com/2011/05/text-to-speech-through-airtunes/
Are there alternative voices? Like male / female?
AFAIK there are no alternative voices