Forum: Projekte & Code MP3 ID3 reader example for ID3 versions 1.0 2.2, 2.3 and 2.4


Announcement: there is an English version of this forum on EmbDev.net. Posts you create there will be displayed on Mikrocontroller.net and EmbDev.net.
von Malte _. (malte) Benutzerseite


Angehängte Dateien:

Lesenswert?

As I did not find a small implementation for reading mp3 ID3 tags, I
wrote it myself.

The code is thought as a sample for own customising.
It can be compiled for an AVR and a Unix PC.
Compiled for an AVR, it needs 1,3KB flash. Please note, that functions
similar as the Unix functions fread and fseek are required in order to
use the code.

Features:

Supports:
     Versions:
       ID3 V1.0
       ID3 V2.2
       ID3 V2.3
       ID3 V2.4
     Formats:
       ISO-8859-1
       UTF-16 with BOM
       UTF-16 without BOM

   Partly supports:
     Flags:
       Jumps over external header
     Formats:
       UTF-8 is handled as ISO-8859-1

   Not supports:
     Umlauts will be removed
     Unsynchronisation
     Extended Tag in ID3 V1.x

Feedback and questions are welcome, especially if you found an (legally
downloadable) mp3 which contains ID3 tags and can't be parsed with my
source.

(Natürlich können Fragen und Anmerkungen auch in Deutsch gestellt
werden).

von Tobias P. (hubertus)


Lesenswert?

Hey Malte,
cool stuff, that was exactly what I searched.
Especially ID3v2 is not that simple, but if your code works it's great!
Thanks a lot.

von Malte _. (malte) Benutzerseite


Angehängte Dateien:

Lesenswert?

I missed umlauts.

The output function now produce ISO_8859-1 instead of ASCII.

If the ID3 is encoded as UTF-8 and the chars can be represented in 
ISO_8859-1, its converted to properly.

von Wurst (Gast)


Lesenswert?

What is the "calcultate framsize" part used for? I don't get its 
sense...

von Malte _. (malte) Benutzerseite


Lesenswert?

Each Frame has a variable size of its data. So the lenght/size is 
encoded in the Head of each Frame.
See
http://www.id3.org/id3v2.3.0#head-1a37d4a15deafc294208ccfde950f77e47000bca

I hope, this helps.

von Wurst (Gast)


Lesenswert?

thx, malte. having read the spec the thing is much clearer.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.