Wednesday, March 9, 2011

DIY audio books with text to speech for free

So, recently I heard of plans for Guillermo del Toro to make a movie of HP Lovecraft's "At the Mountains of Madness".  This news took me to google to find any Public Domain HP Lovecraft stories.  Specifically, HP Lovecraft stories published before 1923 are public domain.  The others might have to wait to be in the public domain in the United States thanks to the US Copyright acts of 1976 and 1998.  For example, "At the Mountains of Madness" was published in 1931, so the copyright should expire in 2026 -- only 15 more years.  Lucky readers of this in Europe can consider any of Lovecraft's work to be public domain because in Europe the copyright for a work is limited to 70 years after the creator's death.  Lovecraft died in 1937, so his work would have entered European public domain in 2007.

My desire to read his stories is limited by my time to do so.  With kids and work and everything I need to do in a day, I don't have the time to sit and read much of his work.  I am not a steady customer of any audobook service, so I decided to make my own audio book as read by a computer.  To do this I used ESpeak ( ).  Just download the program by clicking the link at the top of the page and downloading "espeak" compiled for Windows about at the center of the following page (not espeakedit that is a different program).  Once downloaded, unzip the file and run "espeak-setup.exe" (simply hitting "next" at each step will be just fine for this process.)

Once installed, get the text you wish to turn into a audobook.  Project Gutenberg ( ) is a great source for public domain texts, but I chose to get a Lovecraft story "The Rats in the Walls" ( ).  You can either download the text as "txt" files or select the text from a web page and paste it into notepad and saved as a text file. 

Once you have a text file ready (be sure to look the file over for stray text if you copied it from the web), open espeak (it should be in your c:\program files\espeak\TTSAPP.exe ).  The interface is simple and does not offer much feedback when you are actually creating the audiobook file, so as you go through this process the program will seem to freeze but that is the application creating the audobook file.

The first setting to address in the TTSAPP program is to select a voice.  To get a feel for the voices, leave the text "Enter text you wish spoken here." in the main window and hit the "speak" button.  I suggest you use the "Microsoft Anna" voice, but test each one and decide which you would want to read a whole story to you.

To create the audiobook file, the first step is to use espeak to create a WAV file of the voice reading the text.  To do this, hit the "Open File" button and select the text file you wish to be read.  Once you are ready to have the voice read the text into a file, hit the "Save to .WAV" button and select a location to save the wav output file.  At this point the system will freeze.  The recording appears to occur near real time, so if this is a long story then the TTSAPP program will be  running for a long time.  Once the file is done, TTSAPP will pop up a message that it is complete.

Now you will have a decent sized WAV file, about 10MB per minute of audio.  This must be compressed before you put the file in an MP3 player.  The simplest way to do this is to import the WAV file into iTunes and then right click the file and hit "Create to MP3 version".  

If you don't have iTunes then another option is use Audacity ( ) and LAME ( ).  Install Audacity and then download and install LAME into the LAME folder in the Audacity program files folder.  Once Audacity and LAME are installed and the WAV file is complete, open Audacity and use it to open the WAV file.  If you are feeling extra nerdy, you can split the WAV file into sections to make it easier to listen to.  To create a compressed MP3 version of the WAV file just hit File, Export and MP3 files in the location with the name of your choice.  Audacity will prompt you for the metadata for the MP3 file, this will be helpful if you plan to use this MP3 in an MP3 player.

Now you can enjoy your favorite public domain texts as read by your own personal robot!  Enjoy!

No comments:

Popular Posts