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

mp3 tags displayed not properly (only 1st char) #226

Open
pinwiz opened this issue Jan 30, 2019 · 1 comment
Open

mp3 tags displayed not properly (only 1st char) #226

pinwiz opened this issue Jan 30, 2019 · 1 comment

Comments

@pinwiz
Copy link

pinwiz commented Jan 30, 2019

First I´d like to thank Ed for his fantastic work 1000 times !!!
When playing mp3-files from SD only the first letter of Artist and Title were displayed.
During evaluation it turned out that the ID3tags "TALB" and "TPE1" contained 0x00 each 2nd char (16bit-format?) in my mp3-files.
I added a short pice of code in function "handle_ID3" to remove those 0x00 from the metalinebuffer, that works fine for my problem:

      ...
      sttg -= mp3file.read ( (uint8_t*)metalinebf, stg ) ;  // Read tag contents
      //remove all chr(0) from metalinebf
      int k = 0 ;
      for (i = 0; i < stg; i++) {
        metalinebf[k] = metalinebf[i];
        if (metalinebf[i] != 0) {
          k++ ;
        }
      }
      metalinebf[k] = 0 ;                                          // Add delimiter

      //tenc = metalinebf[0] ;                                // First byte is encoding type
      //if ( tenc == '\0' )                                   // Debug all tags with encoding 0
      //{
      dbgprint ( "ID3 %s = %s", ID3tag.tagid, metalinebf + 1 ) ;
      ...

Maybe this information is helpful for others, or may lead to an improved code.
Reading http://id3.org/id3v2.3.0 shows that decoding is a real drudgery.
Would be nice if somebody would take up the challenge to display the cover art from ID3-tags also :-) (Tag "APIC" - attached picture)

@Danfocus
Copy link

First I´d like to thank Ed for his fantastic work 1000 times !!!
When playing mp3-files from SD only the first letter of Artist and Title were displayed.
During evaluation it turned out that the ID3tags "TALB" and "TPE1" contained 0x00 each 2nd char (16bit-format?) in my mp3-files.
I added a short pice of code in function "handle_ID3" to remove those 0x00 from the metalinebuffer, that works fine for my problem:

      ...
      sttg -= mp3file.read ( (uint8_t*)metalinebf, stg ) ;  // Read tag contents
      //remove all chr(0) from metalinebf
      int k = 0 ;
      for (i = 0; i < stg; i++) {
        metalinebf[k] = metalinebf[i];
        if (metalinebf[i] != 0) {
          k++ ;
        }
      }
      metalinebf[k] = 0 ;                                          // Add delimiter

      //tenc = metalinebf[0] ;                                // First byte is encoding type
      //if ( tenc == '\0' )                                   // Debug all tags with encoding 0
      //{
      dbgprint ( "ID3 %s = %s", ID3tag.tagid, metalinebf + 1 ) ;
      ...

Maybe this information is helpful for others, or may lead to an improved code.
Reading http://id3.org/id3v2.3.0 shows that decoding is a real drudgery.
Would be nice if somebody would take up the challenge to display the cover art from ID3-tags also :-) (Tag "APIC" - attached picture)

Basic UTF-16 support in pull request #231

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants