A small percentage of Audible AAX files – usually radio dramatizations / plays – are encoded at a sample rate of 44.1kHz. These files do not seem to play natively on Android, but are accepted by tools and players on Linux, e.g. mplayer, ffmpeg, etc. Trying to use them with Booksonic causes playback to fail if transcoding is not enabled for m4a / m4b files. Similarly, playing through Plex results in a forced server-side transcode. A bug was filed against Booksonic partly about this:
After much investigation, it seems the only difference between files that play and those that don’t, apart from the sample rate, bit rate, etc., is a single bit set in the “Audio Object Type Specific Config” in the ESDS atom in an M4A file. This bit is described as “dependsOnCoreCoder” in most sources:
Trying to extract the AAC audio to an ADTS file with ffmpeg yields the error “Scalable configurations are not allowed in ADTS”, which would suggest this bit is something to do with Scalable Sampling Rate AAC.
Various code fragments found online suggest that this bit should be followed by several bits of extra data, but this does not appear to be the case in the problematic AAC files – it is possible they are therefore considered malformed:
It turns out that flipping the bit in question is enough to fix these AAC files and make them playable. This can be done with the tools provided at https://www.bento4.com/ . For example: