Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Speak a text file to AIFF' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Speak a text file to AIFF
Authored by: hayne on Jan 03, '03 03:22:21AM

Here's a Bourne shell version (which is perhaps more convenient for use from the Terminal):

#!/bin/sh

# This script uses text-to-speech to convert the text in an ASCII text file
# to an audible form and saves it in an audio file.
# This script expects two command-line arguments:
# The first argument is the name of a text file
# The second argument is the name to use when saving the audio
# (the audiofile name should usually have a ".aiff" suffix)

message=`cat $1`
audiofile=$2

echo "set ofile to POSIX file \\"$audiofile\\"
say \\"$message\\" saving to ofile" | /usr/bin/osascript



[ Reply to This | # ]
backslash screw-up
Authored by: hayne on Jan 03, '03 03:26:08AM

Those double backslashes should be single backslashes.
(Geeklog's preview misled me)
The backslashes are for escaping the double quotes.



[ Reply to This | # ]