Wednesday, September 08, 2004

Text to speech on the Mac.

I bought a hardcover book that I hardly have time to read. The net provided to me (illegally) the same book in HTML. I'd like to have a speech synthesizer read the book into a file which I can listen to in the car. My new Mac has software to do this, but it took me a little time to figure it all out.

This is what I've learned over the last hour.
  • Inside some applications, you can highlight some text and select Services, Speech, Start Speaking Text. In others, it's grayed out.
  • You can even rig up a hot key to have it speak anything that's selected in applications that don't otherwise support speech.
  • In the System Preferences you can choose from a selection of fairly good and fairly silly voices.
  • You can access the voice from scripts to, for instance, announce your incoming email with more than just an alert.
  • There's a 'say' command that lets you access speech from the command line.
That last is what got me what I wanted. You can give 'say' an input and output file, and it will produce an AIFF output. Since oggenc can accept AIFF, I'm home free.

Now, it may turn out that the voice, as good as it is, will not be good enough to listen to for an hour at a time, even if it's speaking a great book. I'll dynamite that bridge when I come to it.
Post a Comment