Forkcasting
As clear as a puddle of mud

Audiobooks

I don't like how much disk space they take

I am a bit of a digital pack-rat. I buy fairly large disks for my machines, then never upgrade. I hate moving computer almost as much as I hate moving house. I am constantly at or near the limits of my disks.

This usually isn't a problem, but it's presented a unique challenge for audiobooks. I found out that I rather enjoy them, but I don't really have the disk space for them. I have, however, found a work around. I convert them to Opus/Ogg at 16 kb/s. My phone speakers render this acceptably well -- I can't tell the difference over that tiny speaker, and I save a huge amount of disk and transfer.

To start, I get my audiobooks as DRM-free mp3. For me, these come as zip files full of mp3s.

Next, I create a track listing. I do this by hand because I haven't worked out how to do it otherwise. Next, I split that track listing up into 4 files using split -l N where N is chosen to be roughly 1/4th the number of tracks. This lets me use all 4 cores on my machine.

Next, I use a script and a bit of xargs magic. The script unzips one file, works out what the new Ogg file name will be and calls ffmpeg. When all is said and done it cleans up.

#!/bin/sh

set -euf  # Safer shell scripting

# Use human-readable names for inputs
INPUT_ZIP="${1}"
INPUT_FILE="${2}"

# Decide were we're saving the input file
OUTPUT_FILE=$(basename -s .mp3 "${INPUT_FILE}").ogg

# Get the target file from our zip file
unzip "${INPUT_ZIP}" "${INPUT_FILE}"

# Convert to Opus/Ogg at 16kb/s, preserving the metadata
ffmpeg -y -i "${INPUT_FILE}" -codec:a libopus -b:a 16k \
   -map_metadata 0 \
   "${OUTPUT_FILE}"

# Clean up!
# I don't want every full-sized mp3 on disk.
rm "${INPUT_FILE}"

I use tmux to split my screen into 4 panes, and in each one I call something like:

cat xaa \
  | xargs -n1 -d '\n' convert Some_AudioBook.zip

I vary the xaa as necessary in each pane.

Finally, I dump the files in Google Drive and pick them up on my phone.

How I listen

I use "Simple Audiobook Player Free". It is simple, but it also supports my cut-down ogg files. It keeps my location and is really easy to use. It is not easy on the eye, but I don't look at it too often.

I download the files from Google Drive and point Simple ABP at it.

I mostly listen while doing housework. If I was still commuting, I'd probably listen while walking to work. I expect I'll listen when I need to run infrequent errands (e.g. to the chemist).

I do occasionally zone out and need to rewind. That's not too much of a problem for me, though it has happened when I've tried to listen while working. My work is too engaging, except when I have to do something very repetitive and dull.

Improvements

There are some small quality of life improvements I could make:

  1. Downloading the files automatically from my audiobook provider. Longer books come as several zip files, doubling the time I spend downloading.
  2. Managing my directory hierarchy. I have directories laid out as Author/Book/.... It'd be nice to point a script at an audiobook and say "go download and extract" one day.
  3. Extracting the track list from the zip files. Currently, unzip seems to always add lots of extra information. I need a cunning use of cut, sed, and maybe even awk to get my track list.
  4. Kicking off 4 "processes" automatically from one track list.
  5. Archiving the original mp3s to AWS Glacier so that I never lose them.
  6. Cleaning up the zip files once they're all extracted.