Tag Archives: audiobook

Converting mp3 to ipod-ready audio books

DISCLAIMER: The below technique works about half of the time: For no readily discernible reason, some of the files come out in chipmunk mode. It appears, from what I’ve been able to determine so far, that mpg123 is playing the original mp3 file at the wrong speed.


As a fan of Librivox, it’s frustrating to me that the iPod doesn’t recognize audio books in mp3 format as audio books. It wants them in aac format. Converting them is a hassle, mostly because I always forget how. So, here’s a little Perl script I whipped up for the purpose.

The same thing is necessary if you rip an audiobook from CD.

Share and enjoy:


opendir F,".";
my @files = readdir(F);
closedir F;

foreach my $chapter (@files) {
    next unless $chapter =~ m/.mp3$/i;

    my $filename = $chapter;
    $filename =~ s/.mp3$//;
    $filename = $filename . '.m4b';

    `mpg123 -s "$chapter" | faac -b 80 -P -X -w -o "$filename" -`;

Note that while this retains the track name, it seems to lose the album name and author, so you may need to add that back. Presumably faac has command-line arguments for this, too, but I haven’t found them yet. Haven’t looked, either.

iPod Chipmonks

I recently discovered that there’s a “faster” setting when you’re listening to Audiobooks on the iPod. What I haven’t been able to figure out is exactly how much faster it is. It is noticeably faster, but the time doesn’t seem to tick by any faster. I timed it on the way to work, and I think I got about 18 minutes of audio into the 14 minute drive, which doesn’t seem like a particularly significant speedup. Something like 1.2 or 1.3. Which means that the 64 hours of War and Peace will take somewhere between 50 and 54 hours. The guy that’s reading it read very slowly anyways, so it doesn’t make it at all hard to listen to. I don’t know how well this will work with other readers.