I'm using JAAD (Java Advanced Audio Decoder) version 0.8.4, and m4a songs imported by the iTunes player from a CD play correctly. Any mp3 songs converted by ffmpeg to m4a results in an JAAD error during the following statement. I have seen this question before, but never any solution. What do I need to do?
for example:
ffmpeg -i input.mp3 -vn -c:a aac -b:a 192k output.m4a
final AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(songFile.toURI().toURL());
net.sourceforge.jaad.mp4.MP4Exception: movie box at end of file, need random access
With MacOS there is a program for converting audio file to a new format, so if the song is a MP3, I convert it on the fly and play it as a MP4. This work just fine and is a quick conversion.
/usr/bin/afconvert -d aac -b 256000 input.mp3 output.mp4 -f mp4f