Generate automated audio books

DiggDigg Registered User regular
Hey,
I have a few long text files on my mac that I'd liked to listen to as audio. Ideally I'd like to generate mp3s (or something that could be converted into that format) from the text files. The only way I can think of doing this is to have the mac read (using the text-to-voice command) some long document while an audio program is recording. The drawback of this is that it would take quite awhile for the robot dude to get through any given file.

So my question is this: Does anyone know of a method, or of a separate piece of software (for mac or windows) that can skip the reading step - just take a text file, process it, and output an audio file.

Thanks in advance for any suggestions!

Digg on

Posts

  • bashbash Registered User regular
    edited February 2008
    Copy this code and past it into a new AppleScript document:
    set osVersion to system version of (system info)
    set inputTextFile to (choose file with prompt "Select a text file to make into an audio file" of type {"TEXT", "Text", ""} without invisibles)
    open for access inputTextFile
    set inputTextContent to read inputTextFile
    close access inputTextFile
    log "This might take a while..."
    if osVersion ≥ "10.5.0" then
    	say inputTextContent using "Alex" saving to file (((path to desktop) as string) & "Add Me to iTunes.aiff")
    else if osVersion ≥ "10.4.0" then
    	say inputTextContent using "Vicki" saving to file (((path to desktop) as string) & "Add Me to iTunes.aiff")
    else
    	say inputTextContent using "Victoria" saving to file (((path to desktop) as string) & "Add Me to iTunes.aiff")
    end if
    

    The AppleScript editor is in /Applications/AppleScript. Save the file as type "Application" and put it somewhere you'll be able to find it. It will create an AIFF (like a WAV file) on the desktop and then you can drag that into iTunes. When you do it will compress it to whatever import setting you use for CDs. You can then rename it and add it to your iPod. There's no extra software or anything needed.

    Edit: Here's a link to a text version and application bundle of this script. It should run on everything from Panther to Leopard. Linky

    bash on
    comi-sig1.jpg
  • DiggDigg Registered User regular
    edited February 2008
    Thanks bash, that's excellent! I've just run it and it works perfectly :)

    Digg on
  • bashbash Registered User regular
    edited February 2008
    Sweet. There's a tool somewhere on the interwebs that can convert an MP3 or M4A into a proper M4B so iTunes/iPod will save the play head position. It might be as simple as renaming an M4A file name.m4b and then copying it into iTunes. For something relatively long you won't need to seek through the file to pick up where you left off. I will investigate more on the interwebs.

    bash on
    comi-sig1.jpg
  • ben0207ben0207 Registered User regular
    edited February 2008
    In iTunes, just right click and "Get Info", then on the Options tab you can remember Playback position.

    ben0207 on
Sign In or Register to comment.