After reading a hint on macosxhints on how to create an audio file from text, because I wanted to keep reading my book while I was driving, and figured that holding the book in front of me probably wasn’t the best option, I figured the process could probably be streamlined a bit.
So, I’ve made a service which appears in the Services menu and operates on selected text. So, select it in Safari, or from an eBook in Preview (or Textedit if it’s just plain text), and click ‘Speak to iTunes Audio Book‘ to speak the text into a track in iTunes that will appear in ‘Audiobooks’.
Update: Note that Snow Leopard now includes its own built-in service to perform this function. The only difference is that the resulting audio file from the new built-in service is a plain ‘music’ track, not specifically an audio book.
Just remember to set the encoder quality beforehand, because it’s not configurable through Applescript (I recommend ‘Spoken podcast’).
Download the thing here: SpeaktoItunesAudiobook.pkg
Speak to iTunes Audiobook Service
This service will take the selected text from any application, convert it to an audio file, using Apple’s excellent speech engine, and import the file into iTunes as an audio book (bookmarkable file).
It will use the AAC encoder with the default settings. I recommend using the ‘Spoken Podcast’ setting, as a higher quality really isn’t necessary, and the file sizes are kept nice and small. Before running the service, set this in iTunes (Preferences, Advanced, Importing, select ‘AAC Encoder’ under ‘Import Using’, and ‘Spoken Podcast’ under ‘Setting’.
Service will be installed under Library/Services, in either your home folder or the system volume. Just delete it to uninstall. Enjoy!
I’ve used a few ideas from the excellent Doug’s AppleScripts for iTunes; in particular, I figured out how to make a bookmarkable file from reading ‘Make Bookmarkable v2.4’, and how to get iTunes to encode stuff from reading ‘Quick Convert 2.7’.
Service was created from Applescript by Waffle Software’s ThisService