Mp4 CannotReadException: Unable to determine start of audio in file, fails ungracefully

Issue #83 new
Dell Green created an issue

org.jaudiotagger.audio.exceptions.CannotReadException: Unable to determine start of audio in file (even though file plays and meta-data tags are fine)

Source code throws exception (Mp4AtomTree.java Line 200) documented that the exception is thrown to protect writing to the file later on, however meta-data has been parsed ok and file plays fine. For read-only meta-data projects it would be nice to still be able to get at the data without exception.

Could it be possible to mark the file internally as read-only (and/or log a warning) as the file is still playable and useful meta-data is still extracted for files that suffer from this problem? Some people may only be interested in reading meta-data and not writing to the file like me, For now i have just removed the CannotReadException and returned the dataTree object in Mp4AtomTree.java Line 200 which fixes it for my requirements, but may not be the complete solution.

Caused by: org.jaudiotagger.audio.exceptions.CannotReadException: Unable to determine start of audio in file at org.jaudiotagger.audio.mp4.Mp4AtomTree.buildTree(Mp4AtomTree.java:191) at org.jaudiotagger.audio.mp4.Mp4AtomTree.<init>(Mp4AtomTree.java:82) at org.jaudiotagger.audio.mp4.Mp4InfoReader.read(Mp4InfoReader.java:317) at org.jaudiotagger.audio.mp4.Mp4FileReader.getEncodingInfo(Mp4FileReader.java:41) at org.jaudiotagger.audio.generic.AudioFileReader.read(AudioFileReader.java:104) at org.jaudiotagger.audio.AudioFileIO.readFile(AudioFileIO.java:285) at org.jaudiotagger.audio.AudioFileIO.read(AudioFileIO.java:148) at com.amazon.cirrus.MusicFileMetadata.<init>(MusicFileMetadata.java:91)

Comments (2)

  1. IJabz repo owner

    Hm,. Im a bit suprised it does play okay if the offsets are incorrect but fair enough, Im struggling to work out a proper solution for this that allows you to read the metadata but doesnt give the false impression that the file is safe to write to.

  2. Log in to comment