Audio books from blog posts

Sometimes it is convenient to listen to a book in audio format rather than to read it. This way we can take advantage of driving, cooking or exercise time to listen to books. This technique is also useful for reading technical documents, blog posts or other articles with little emphasis on graphics.

A large amount of text content is not available in audio format. Fortunately mac users can take advantage of Apple’s native text to speech technology to convert text into an audio file.

Ryan Stewart recently wrote a blog post comparing the iPhone to Android phones. Rather than reading it on the internet we can translate and record the post into an audio file and listen to it on an mp3 player later on.

Firstly we need to extract the text content of the post into a simple plain text file. The easiest way to do this is to select all of the text, then copy and paste it into a new text file, and save it to the computer.

Now that we have our text content ready we need to open up Terminal, the Mac’s command line interface, which can be found under the Applications > Utilities folder. In order to convert our text into an audio file we need to use the Mac’s say command:

say -f /path/to/file/r_stewart_iphone_v_android.txt -o /path/to/file/r_stewart_iphone_v_android.aiff

[in_article_ad]’say’ opens the Mac’s say application. ‘-f’ instructs the application to open and use a text file as it’s source. ‘/path/to/file’ will need to be changed depending on where we have saved our text file. ‘/r_stewart_iphone_v_android.txt’ will also need to change depending on the name of the saved text file. ‘ -o’ tells the application to save it’s audio output to file, without this parameter the content will be spoken straight through to the speakers. ‘ /path/to/file’ specifies the output directory for the audio file this time, it can be the same directory as the text file. ‘/r_stewart_iphone_v_android.aiff
‘ specifies the name of the audio file, this can also be changed, however .aiff needs to be used for the extension, this is the Mac’s native audio file format.

On average Mac’s can encode roughly 20 pages a minute. The .aiff files produced may become quite large and can be dramitically reduced in size if they are converted to the mp3 or aac format in itunes.


Leave a Reply

Your email address will not be published. Required fields are marked *