For some files, audio_content starts inside the ID3v2 tag. I haven't fully debugged the problem, but I suspect one of
the following two causes:
1. faulty ID3v2 tag where the overall length is set smaller than the actual length. a possible workaround for this case
would be to recalculate the actual length by parsing each frame until we reach a sync or the padding and then simply
setting @io_position to @io.pos -- this seems to work for my test-case
2. you need to add 10 to @tag_length in from_io to account for the preamble of the ID3v2 header
I could provide you with an .mp3 that triggers this problem for me if you feel it would help (won't upload it here because
it's copyrighted).
PS: in read_id3v2_3_frames and read_id3v2_2_frames, you have @io.pos >= @tag_length as a termination condition. I
think, that should be @io.pos >= @io_position.
Thank you for your useful library!
|