Sunday, December 6, 2009

Mac OSX - Text to Speech Automator Script


A handy automator script to convert text to speech, playing for us the result, then dump to an aiff.  Found the idea on google, and added some tweaks to make it a little more friendly.  Dead simple to build, and if blogger allowed me to host files, I would.

To build your own, open automator, start a custom automator job, and select the following modules:



The key is the variable--this saves the results of the text you enter in step one, and later, becomes the filename of the resulting aiff file in step 4.  Note in step 4 we have created a directory somewhere on our harddrive (mine is /media/samples/wav/speech) to dump all our files.  

Breakdown of how it works
Ask for Text
Here, we are simply asking us to key in what we want our text to speech automator job to pronounce.

Set Value of Variable
We created a new variable "SayText" to store the results of our request above.  You could name the variable anything when you are creating your own version.

Speak Text
This step plays for us the results of our entry, In this step, make sure to select the voice you want to use--and make sure its identical to the next file.  

Text to Audio File
This step saves the text to speech to an aiff file--by re-rendering our text entry in step one to disk. We'll need to make sure our voice is the same as Speak Text above.  With step two, we should have a variable section at the bottom, so make sure to drag the variable "SayText" to the Save As field.  Then select a suitable directory to dump your results--and remember to go back and clear it out occasionally!

Loop
Frequently, text to speech produces bizarre results, so a given line of text will have to be phonetically tweaked to get it to sound correctly.  Looping thru the automator script makes it easy to do so.


2 comments:

Write what you think. If things get spammy, review time.