Hi Khalid,
If I have understood your problem correctly, you want to extract ID3 tag and if possible Lyrics Tag in MP3 file. For version2(v2), it is stored after the encoded data, to extract it, you have to go at the end of the file. I have done this in my own way. What I did was like this,
1. fseek(pFile, filesize - 10000, SEEK_SET);
This 10000 number was arbitrary. To accomodate Lyrics space. But if it is only ID3 tag present in the file, you can reduce this number to a mere 100.
2. fread(pBuffer, 1, 1000, pFile);//Lyrics Tag is also present Otherwise go 10 byte at a time. ststr(pBuffer,"ID3"). If strstr does not work in your compile(possible), go by the stupid process of matching byte by byte.
When you found the ID3 tag, extract the information as per the specification of ID3 tag.
You have to do this even before start decoding MP3 file.
In case of encoding write the information, write the information after encoding is done. <ID3> <FILE> <Artist>
</Artist> </FILE> </ID3>
In Case of version 1(v1) however ID3 tag is at the beginning of the file. Then you dont have to go at the end of the file.
Kind Regards,
Sayak
----- Original Message ----- From: mad-dev-request@lists.mars.org To: mad-dev@lists.mars.org Sent: Wednesday, January 17, 2007 1:30 AM Subject: mad-dev Digest, Vol 18, Issue 3
Send mad-dev mailing list submissions to mad-dev@lists.mars.org
To subscribe or unsubscribe via the World Wide Web, visit http://www.mars.org/bin/mailman/listinfo/mad-dev or, via email, send a message with subject or body 'help' to mad-dev-request@lists.mars.org
You can reach the person managing the list at mad-dev-owner@lists.mars.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of mad-dev digest..."
Today's Topics:
- MP3 tag (Khalid Aallouche)
Message: 1 Date: Tue, 16 Jan 2007 07:41:19 +0200 From: Khalid Aallouche khalid.aallouche@tut.fi Subject: [mad-dev] MP3 tag To: mad-dev@lists.mars.org Message-ID: 20070116074119.76hpnvh4pw0cck4o@webmail.tut.fi Content-Type: text/plain; charset=ISO-8859-15; DelSp="Yes"; format="flowed"
Hi all,
I send you that email because I want to extract the Genre (rock, salsa...) from the MP3 file. I have studied libid3tag source code and I don't know how to perform that. I will be very grateful if someone can help me.
In a second step, I want to write tags in an MP3 file (tagg v2).If someone can tell if it's possible to do that with libid3tag.
Thank you for your comprehension b.r, Khalid
End of mad-dev Digest, Vol 18, Issue 3