Speeding up audiobooks -- or an example of MPlayer usage and why it rocks

This Christmas I received a Googled: The End of the World as we Know it on no less than 12 CDs. If you think I am going to sit and listen to all 14 hours of those discs, you are sorely mistaken. Instead I will take advantage of the something Cross-Ex debaters have known since the dawn of time: people can understand the spoken word, even when accelerated to an absurd pace.

Mplayer Speeds sans the Chipmunks
I love MPlayer, the Linux everything player, for many reasons. One of them is the ScaleTempo audio filter. This filter allows you to speed up playback without increasing the pitch of the media. Get out a terminal and see it for yourself:

versus
mplayer -playlist http://www.bbc.co.uk/radio4/arts/ram/agoodread.ram -speed 1.5 -af scaletempo

Normally I would just play the audiobook in MPlayer (or SMPlayer, actually, since its a great frontend), but I want to listen to Googled on my mp3 player, which doesn't run mplayer. The solution? Have mplayer speed up the audio and generate mp3.

The Command
This command will play the audiobook the way I want it to sound
mplayer disc01.wav -speed 1.5 -af scaletempo

-speed sets a 1.5x multiplier on playback rate
-af scaletempo sets mplayer to use the scaletempo audio filter and avoid the chipmunk effect

But I don't to play the book, I want to convert it to another digital form.
mplayer disc01.wav -af scaletempo -speed 1.5 -ao pcm:file=disc2fast.wav

-ao pcm:file=disc2fast.wav Send audio output to the fake PCM device instead of your speakers. Result: a wav file!

Viola, a static audio file sped up 1.5 times. Now I just convert that to an mp3, load to my player, and go!

Colin

Note: Since there were 12 files to process, I didn't do this speed each up manually. Instead I grabbed a script from http://gimpel.gi.funpic.de/wiki/index.php?title=Howto:convert_aac/mp4_to_wav/mp3/ogg_on_Linux and modified it to speed up input files 1.5 times.

audio2mp3_1.5x
#! /bin/bash
#
# Converts an Audio file to a MP3, speeds it up 1.5x, and adds an ID3 tag.
#
# Usage: audio2mp3_1.5x infile [outfile]
#
IFS=";" title_author=(`mplayer -vc null -vo null -af extrastereo=1.5 -af scaletempo -speed 1.5 -ao pcm:fast -ao pcm "$1" -ao pcm:file="$1.wav" 2>&1 | awk -F: 'BEGIN { ORS = ";" } ; $1 ~ /name|author/ { print $2 }'`)
author=${title_author[0]}
title=${title_author[1]}
echo "Author: $author"
echo "Title: $title"
lame "$1".wav "$2" --tt "$title" --ta "$author"
rm "$1".wav 

Make sure it is marked executable!