Thursday, January 26, 2012

Text-to-Audio on my Mac

I recently experimented a little with creating speech from a given text.

First of all I had not known that this functionality existed on my Mac. A little web search discovered a number of pages explaining the functionality but for the sake of the reader (and maybe even more my own's sake not having to remember all this stuff) I'll describe it here.

There are two applications involved:
  1. TextEdit where you write the text to be converted to speech
  2. Automator which will do the conversion
So in the first step open TextEdit (Finder->Applications->TextEdit) and write some text which you would like to hear.
Then you need to start Automator (Finder->Applications->Automator).
  • In the first window choose the workflow Text .
  • Change the field Get content from and select TextEdit
  • Click the Choose button
  • In the lefthand column under Library click Text and in the next column double click Text to Audio File.
  • In the Text to Audio File frame you can choose a voice by selecting an entry in System Voice: I pick Alex.
  • Choose a filename (it will be saved in aiff format) and a location where to store the result.
  • Click the Run button in the upper righthand corner of Automator. Now your text should get transformed into speech and a file containing the output will be created.
  • Click the Results button in the Text to Audio File frame. Listen to result by double clicking on the file icon.
The recipe above works fine if you do text to speech translation once in a while.

Regular task:
If you do it regularily you can create an Automator workflow and reuse it whenever needed. Simply do a 'Save As...' and save this workflow under a recognizablee name. Note that it will always use the same output filename and location and this overwrites previous audio files.

More voices:
You can also download and install other voices if you're not happy with the standard ones. Good ones possibly need to be paid for, some sites offer trials e.g. InfoVox from Assistiveware.

Speech control:
You can insert certain control elements into the text to better control the speech like volume changes of certain words, extra pauses etc. I have been using the silence element e.g. a pause of 5 seconds can be achieved with [[slnc 5000]]
Here is a comprehensive list of speech commands from Apple (the page seems to be deprecated but the commands still work).

No comments:

Post a Comment