Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lyrics Tag showing undefined characters [working solution implemented already] #15

Closed
n3rfd opened this issue Jul 20, 2020 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@n3rfd
Copy link

n3rfd commented Jul 20, 2020

Thank for your amazing effort to get this library to where it is now, and it has been pretty useful thus far.

I am using this library to extract the lyrics tag from an mp3 file that contains both English and Japanese characters and encountered an issue because the first few characters were showing invalid symbols.

I have already figured out the problem and just wanted to share here how I resolved it.

The first few bytes of the lyrics tag contains the following sequence:

[101, 110, 103, 255, 254, 0, 0, 255, 254, 49, 0, 46, 0, 32, 0,...]

I figured out that to remove the invalid characters, I just need to remove the first seven bytes so that the frame will start at the 8th byte. So I modified your clearFrameData() from id3v2_frame.dart.

List<int> clearFrameData(List<int> bytes) {
    var key = 0;
    for (var i = 0; i < bytes.length; i++) {
      if (bytes[i] == 0xFF && bytes[i + 1] == 0xFE) {
        key = i;
      }
    }
    return bytes.sublist(key);
 }

From the latest release, you seem to have stopped using clearFrameData() so I am just writing this stuff here rather than create a new PR.

@n3rfd n3rfd added the bug Something isn't working label Jul 20, 2020
@NiKoTron
Copy link
Owner

NiKoTron commented Aug 9, 2020

hi @n3rfd, could you please check the latest (0.3.0) version?

@n3rfd
Copy link
Author

n3rfd commented Aug 12, 2020

I checked 0.3.0 this morning and the issue about undefined characters in the lyrics tag is no longer reproducible. Thanks!

I found a couple of issues while testing 0.3.0, tho.

  1. model/lyrics.dart is not exported, I think all models that implement KeyEntity need to be exported by the dart_tags library so it can be used by the client code
  2. picture tag is no longer being extracted and returned from calling getTagsFromByteArray()

@NiKoTron
Copy link
Owner

Thanx for the report! yep, exactly It should be exported. my bad I missed it.

There was a change with image extracting.
Well, about the picture tag. Could you please provide an example where it doesn't work? Actually It works well on tests. and my own files. Anyway, I create a separate issue for this one. - issue 16

@n3rfd
Copy link
Author

n3rfd commented Aug 13, 2020

Thanks @NiKoTron , I will get you a sample audio file.

@n3rfd n3rfd closed this as completed Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants