Make Mac OS X Speak (or Sing) the Output of Any Command Line Task

May 11, 2012 - 2 Comments

Speak the output of a command line task

Along the lines of vocally announcing task completion within the command line, you can also have Mac OS X speak the output of any executed command.

This is really easy, all you need to do is pipe the output of any command directly to “say” like so:

uptime | say

In that example, this will speak the output of uptime using the default OS X text-to-speech voice, though you can change the voice to anything else with the -v flag:

uname -a | say -V Samantha

Taking this a step further, it is possible to export the spoken command output to an audio file. Here’s a pointless example of saving the spoken output of the openssl manual page as an m4a file:

man openssl | say -v Samantha -o "talkopenssltome.m4a"

If you want to get ridiculous, you can use one of the singing voices to, well, sing the output of a command. And who doesn’t want an audio file of of the robotic Cellos voice or the awfully perky Good News singing the output of a manual page? Put it on your iPod for the drive home.

man openssl | say -v Cellos -o "serenadingmanpages.m4a"

If you don’t like the bundled voices you can always add new voices to OS X for free through Speech preference panel.

Get creative, because the ultimate utility of this is entirely up to you.

Thanks to Greg P for pointing this out in the comments

Related articles:

Posted by: William Pearson in Command Line, Fun, Mac OS X, Tips & Tricks

2 Comments

» Comments RSS Feed

  1. David says:

    LOL I am going to dump these into my coworkers iTunes library. Good times.

  2. Romney says:

    Yes. Sing it.

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

OSXDaily on Facebook

OSXDaily on Google+

Shop at Amazon

Ad

Shared on Facebook