Wav Deleting Info tag reading size as BigEndian instead of littleEndian

Issue #81 resolved
Octavio Calleya (Otto) created an issue

Hi. I'm working on a music application and I use jaudiotagger. I really appreciate your work. I'm trying to read/write information of wav files as this:

File file = new File(path);
WavFileReader wfr = new WavFileReader();
AudioFile audioFile = wfr.read(file);
WavTag tag = (WavTag) audioFile.getTag();

But the program freezes at the wfr.read() method. Am I doing it right? Do you have the same problem? I tried retrieving th AudioFile with AudioFileIO.read() but the result is the same. Thanks in advance

Comments (17)

  1. IJabz repo owner

    Please try building the latest source, if it still fails email support@jthink.net the file so I can test it

  2. Octavio Calleya (Otto) reporter

    I changed the wav file to test with and using AudioFileIO.read() i get this:

    oct 07, 2015 5:41:30 PM org.jaudiotagger.audio.wav.WavTagWriter write
    INFORMACIÓN: Writing tag to file
    oct 07, 2015 5:41:30 PM org.jaudiotagger.audio.generic.AudioFileWriter write
    GRAVE: Cannot make changes to file /Users/Octavio/Test/testeable.wav because null
    java.lang.IllegalArgumentException
        at sun.nio.ch.FileChannelImpl.position(FileChannelImpl.java:277)
        at org.jaudiotagger.audio.wav.WavTagWriter.deleteTagChunk(WavTagWriter.java:298)
        at org.jaudiotagger.audio.wav.WavTagWriter.deleteInfoTagChunk(WavTagWriter.java:257)
        at org.jaudiotagger.audio.wav.WavTagWriter.saveBoth(WavTagWriter.java:724)
        at org.jaudiotagger.audio.wav.WavTagWriter.write(WavTagWriter.java:332)
        at org.jaudiotagger.audio.wav.WavFileWriter.writeTag(WavFileWriter.java:37)
        at org.jaudiotagger.audio.generic.AudioFileWriter.write(AudioFileWriter.java:432)
        at org.jaudiotagger.audio.AudioFileIO.writeFile(AudioFileIO.java:483)
        at org.jaudiotagger.audio.AudioFileIO.write(AudioFileIO.java:212)
        at org.jaudiotagger.audio.AudioFile.commit(AudioFile.java:123)
        at tests.unit.WavParserTest.id3TagFile(WavParserTest.java:155)
        at tests.unit.WavParserTest.wavId3TagTest(WavParserTest.java:73)
    
  3. Octavio Calleya (Otto) reporter

    I've just test it with the current source code and I have this trace:

    oct 07, 2015 8:05:23 PM org.jaudiotagger.audio.wav.WavInfoReader readChunk
    INFORMACIÓN: Reading Chunk:fmt :starting at:12:sizeIncHeader:24
    oct 07, 2015 8:05:23 PM org.jaudiotagger.audio.wav.WavInfoReader readChunk
    INFORMACIÓN: Reading Chunk:LIST:starting at:36:sizeIncHeader:22150
    oct 07, 2015 8:05:23 PM org.jaudiotagger.audio.wav.WavInfoReader readChunk
    INFORMACIÓN: Reading Chunk:data:starting at:22186:sizeIncHeader:38806684
    oct 07, 2015 8:05:23 PM org.jaudiotagger.audio.wav.WavTagWriter write
    INFORMACIÓN: Writing tag to file
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.tag.datatype.AbstractString getTextEncodingCharSet
    GRAVE: text encoding:0 charset:ISO-8859-1
    oct 07, 2015 8:05:23 PM org.jaudiotagger.audio.generic.AudioFileWriter write
    GRAVE: Cannot make changes to file /Users/Octavio/Test/testeable.wav because null
    java.lang.IllegalArgumentException
        at sun.nio.ch.FileChannelImpl.position(FileChannelImpl.java:277)
        at org.jaudiotagger.audio.wav.WavTagWriter.deleteTagChunk(WavTagWriter.java:298)
        at org.jaudiotagger.audio.wav.WavTagWriter.deleteInfoTagChunk(WavTagWriter.java:257)
        at org.jaudiotagger.audio.wav.WavTagWriter.saveBoth(WavTagWriter.java:724)
        at org.jaudiotagger.audio.wav.WavTagWriter.write(WavTagWriter.java:332)
        at org.jaudiotagger.audio.wav.WavFileWriter.writeTag(WavFileWriter.java:37)
        at org.jaudiotagger.audio.generic.AudioFileWriter.write(AudioFileWriter.java:432)
        at org.jaudiotagger.audio.AudioFileIO.writeFile(AudioFileIO.java:483)
        at org.jaudiotagger.audio.AudioFileIO.write(AudioFileIO.java:212)
        at org.jaudiotagger.audio.AudioFile.commit(AudioFile.java:123)
        at tests.unit.WavParserTest.id3TagFile(WavParserTest.java:154)
        at tests.unit.WavParserTest.wavId3TagTest(WavParserTest.java:72)
    
  4. IJabz repo owner

    Thankyou I have replicated this issue, there seems to be a problem with deleting exisiting INFO chunk when it is not at the end of the file.

  5. IJabz repo owner

    Fixed, when try and deleting existing tag we were incorrectly reading INFO/ID3 chunk header size as BigEndian instead of LittleEndian

  6. Octavio Calleya (Otto) reporter

    One last question. Until the 2.2.5 master version is released, I can build the project to a jar, but how can I modify the logger level to not to see the ones generated by jaudiotagger? I get dozens of org.jaudiotagger.tag.datatype log lines, mostly of type SEVERE:text encoding:0 charset:ISO-8859-1 in getTextEncodingCharSet

  7. IJabz repo owner

    oh I should reduce that logging i'll do tomorrow. But it uses standard logging, you can adjust using a logging.properties file

  8. Octavio Calleya (Otto) reporter

    Hi again. I know now how to adjust the logging level by the logging.properties, but i wnt to report that i get several org.jaudiotagger.tag.id3 log lines per file, like

    WARNING:Problem reading datatype within Frame Body:Unable to find null terminated string in read

    SEVERE: [filename] :An error occurred within abstractID3v2FrameBody for identifier:COMM:Unable to find null terminated string in readBody

    WARNING: [filename] :Corrupt Frame:Unable to find null terminated string in readFrames

    but the program does not crash or something. jaudiotagger works good but it shows those logs.

  9. IJabz repo owner

    These messages are nothing to do with this issue, but certainly the first one is already fixed in the latest source, it was due to jaudiotagger not recognising the null padding

  10. Log in to comment