Play m4a files in Java

user1839433 picture user1839433 · May 23, 2013 · Viewed 7.6k times · Source

I want to create a media player in Java. The mp3 support already works with the JLayer library but which library can play m4a files?

I read about vlcj here on stackoverflow, but this seems to depend on Swing/AWT which I wouldn't use because I want to port the application to Android later on.

Answer

Michael Berry picture Michael Berry · May 23, 2013

Have you looked at JAAD? It's a Javasound SPI that decodes AAC audio, I've used it with success previously.

Note that m4a is a container format, and while it usually contains (in my experience) AAC audio, in theory it could contain other formats instead.

You can find some information about getting it working without Javasound (and a test case) here.