ID3 Tagging Audio Book Files

For whatever reason, the audio books we get at the library sale generally don’t have CDDB database entries, so I fill in the appropriate values by hand. Weirdly, some individual CDs within a single book do have entries, which confuses the process (well, me) no end unless I notice it first; I’ve turned off auto-lookup to make that problem Go Away. Perhaps a different database would help, but I don’t do this nearly often enough to care that much.

Given that:

  • Mary plays the tracks sequentially from start to finish
  • The tracks don’t correspond to book divisions
  • She doesn’t care about the details

I concluded a simple track naming convention that sorts in ascending alphabetic order would suffice.

Asunder auto-fills the fields after the first CD. After a bit of manual wrestling to extract an error-filled track, I had a directory full of MP3 files with informative, albeit slightly redundant, names:

1901-01 - Track 01.mp3

Alas, the ID3 fields apply to a single music CD, with track numbers and names within a single album and no notion of a multi-CD set. I use the “year” field as a CD sequence number; it must be a four-digit year and, seeing as how Asunder defaults to 1900, the first CD becomes 1901.

So the following fields apply:

  • Genre: “Audio Book” (for v2 tags) or Speech (v1 tag = 101)
  • Artist: author
  • Album: book title
  • Year: 19 + CD number within set as 1901
  • Track Name = CD number + track number as “D:01 T:01”

But the real gotcha is that the Most Favorite MP3 Player (remember MP3 players?) recognizes only ID3 v1 tags and Asunder writes only ID3 v2 tags.

Fortunately, the id3v2 utility can do this thing. Rather than screw around selecting each file, extracting the v2 tags, doing something horrible involving bash or sed or awk or whatever, and ramming the results into v1 tags, I just fed in the appropriate number of CDs and more than enough tracks, then ignored any errors concerning missing files.

Firing a Bash cannon broadside:

for d in {01..15} ; do id3v2 -1 -a "Who Wrote It" -A "The Book Title" -y 19$d -g Speech 19${d}* ; done
for d in {01..15} ; do for t in {01..15} ; do id3v2 -1 -t "D:${d} T:$t" -T $t 19${d}-${t}* ; done ; done
for d in {01..15} ; do for t in {01..15} ; do id3v2 -2 -t "D:${d} T:$t" -T $t 19${d}-${t}* ; done ; done

The last line tightens up the title name tag in v2 format to fit the MP3 player’s teeny display. The next time around, I should remove the “Track” text from the file name for consistency.

And then it just worked…

2 thoughts on “ID3 Tagging Audio Book Files

  1. I would say that MusicBrainz has the highest quality data. Its Picard tagger tool is rather useful, and when something isn’t contained it’s about as much effort to put it on there as it is to just type the information locally.

    That being said, I have no idea how it does on audiobooks. I only read those things. ;)

    1. Wow, a “cross-platform” program that runs on something other than Windows and Mac… [grin]

      Plus, it’s in the Ubuntu repository, although a bit behind the current version. Probably good enough for my simple needs.

      Thanks for the tip!

      no idea how it does on audiobooks

      Mary can listen while quilting. I don’t have enough attention for anything other than what I’m doing…

Comments are closed.