Using AAC music files in Android

If you have an file with .aac extension, it is AAC encoded audio in an ADTS container. If you want to play such file on an Android device, you have problems. Android 2.x does not support this file format at all, and not even the latest version of Android supports reading metadata tags from it.

The solution is to repackage the audio in an MPEG-4 container to a file with .m4a extension. Android can both play and read metadata tags from such files.

This can be done with the MP4Box tool. You can also add metadata tags while repackaging:

MP4Box -itags "artist=${ARTIST}:name=${TITLE}:genre=${GENRE}" -add ${FILENAME}.aac#audio ${FILENAME}.m4a

If I understand it correctly, this will not recode the actual audio data, and thus not affect the quality in any way. The file size will also be almost the same.

This entry was posted in Android, Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

(this is a captcha)