Generate Playlists for Audible books in MP3

Posted on Mar 5, 2023

I’ve collected a lot of audio books from Audible over the years - 147 at last count, with 9 credits still in the bank. One of the ways I like to use audiobooks is on long motorcycle rides - it’s a great way to pass the time when you’re doing 1,000 or 1,500 miles on a one-day ride.

On the FJR, I use a Garmin 550 GPS for both navigation and entertainment. The Garmin plays MP3 audio files, Audible audiobooks, and XM Radio with their antenna. I had an XM Radio subscription for many years, but the constant increases and lack of flexibility finally caused me to cancel a few years ago. I left the antenna mounted on the bike - on a special adapter that mounts on the clutch reservoir - for quite a while, but took it off last week. The adapter is still in place, but I have a new RAM mount plate on order that will replace the XM antenna plate. My current plan is to mount my Pixel 5a on the new RAM ball to have in addition to my Garmin.

One of the problems with the Garmin and audiobooks is the complicated process of moving audiobook files onto the unit. The tools provided by Audible were always weak, but their recent focus on smartphones and away from other devices made it even worse. My solution was to convert my Audible books into DRM-free MP3s, and play them using the Garmin’s MP3 player.

I’m using the OpenAudible tool to download my Audible library and convert it from AAC to MP3, and I’ve been quite happy with it. I had to spring $19 for the advanced tools, but when you consider the cost of all 147 books, it made sense to have MP3 copies of everything both for easy access and for backup.

Now, audiobooks in MP3 have separate issues on the Garmin, the biggest being it doesn’t save the place within a file when you turn off the bike or take a break to listen to something else. If you have one, big MP3 file for a 10 hour audiobook and you lose your place, you have to manually fast-forward to the general spot you’re looking for, which can be tedious and distracting while you barrel down an interstate.

For the Garmin, the best solution is to break the books into separate MP3 files by chapter.
Thankfully, OpenAudible includes this in their toolset. It takes a while, but the process is start-and-forget so it wasn’t difficult.

On the Garmin, it’s almost imperative that each audiobook has an associated M3U playlist file, so that everything plays in the normal order. OpenAudible doesn’t have that feature, so I put together my own scripts for building an M3U playlist file by folder. Here’s the script:

#!/bin/bash

where=`pwd`
m3ufile=`basename "$where"`

echo $m3ufile

find . -name "*.mp3" -printf "%f\n" > "${m3ufile}.m3u"

Conventional wisdom is to use fprintf to write the M3U file, but on my Ubuntu system this results in a ./ prefix on each line which the Garmin doesn’t like.

I’m currently only processing each book’s folder one at a time, but it would be easy to add another small script to walk the folders and generate the playlists.