Übersetzungen dieser Seite:

Convert audiobooks to MP3 format (an own way)

The time has come, I've decided to minimize the effort involved in Audible conversion. Since I've wanted to learn Pathon for a long time, I decided to implement it with Python.

I want to describe here how to convert Audible format to MP3 and how I implemented it.

First of all: I am not going to describe a way to free audio books from DRM restrictions, just how to convert Audible content you have bought yourself into MP3 format for use on devices that do not support the AAX format.

Since July 2015, the freely available utility ffmpeg supports AAX decoding. The matching parameter is „-activation_bytes xxxxxxxx“. This works fine once you get the value for xxxxxxxx, but more on that later. Using ffmpeg is a science in itself though 8-) .

I'm lazy, so I wanted to come up with the most elegant way to do everything with a double click. Audible files can work with a wide variety of programs, so I had to make the right choice here. You can choose from:

  • The Audible Manager - once intended to listen to titles on a laptop
  • Itunes - is required to listen to .aax files on the iphone or the ipods that were still made at the time
  • Audible App - The latest craze, an app to listen to stories on your phone or PC without third-party software

You can find exactly how to get the activation bytes here as a step-by-step guide

After successfully converting a complete audiobook into a single MP3 with „ffmpeg -activation_bytes 7db19102 -i <hoerbuch.aax> <hoerbuch.mp3>“, a few points went through my mind and I found the following answers:

  • the chapters are missing in MP3 format
    • The audiobook must be divided into chapters, the ffmpeg options „-ss“ and „-to“ are suitable
  • Can I influence the quality of the output?
    • Of course, an encoder offers ways to do this, „-qscale:a 3“ (the value 3 corresponds to a variable bitrate of 150-195, see the ffmpeg documentation
  • Where did the metadata like title, album etc go
    • You have to explicitly instruct ffmpeg to take this with you, „-map_metadata 0“ copies the global metadata
  • If I divide this into chapters, I need a separate title and track number for each chapter
    • This works too - „-metadata title='Chapter 1' -metadata track='001'“
  • The whole thing should happen without manual intervention if possible
    • I don't always want to select an audio book with the mouse, but edit all new audio books in one go
      • The program needs an input directory and an output directory. All audio books in the input directory are converted and then marked as completed. The latter is done after successful processing by moving it to the „converted“ subdirectory. A separate subdirectory is created for each audio book in the output directory (based on the album title).
  • It must be possible to save the conversion specifications
    • A second program for maintaining the settings must be created as a GUI

Now get to work and solve the task with a programming language that I only know rudimentarily. Three days later, after heavy use of a search engine, after analyzing existing code (see -chapter-using-ffmpeg), a lot of detail work and optimization of the ffmpeg options was done. I now have 2 Python scripts and can automatically convert the audiobooks downloaded from the Audible app to MP3 format. I'm making this freely available to everyone, but please let me know about any improvements, bug fixes, etc. You can find the email address in the imprint my website.

download directory at GitLab

en/howtos/aax2mp3_neu.txt · Zuletzt geändert: 2023/11/15 15:05 von