CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2011
    Posts
    1

    How to erase or write ID3v2 tags to MP3s

    Hi. I know some people have asked similar questions before on this forum, but none of those threads seem to address the problem I'm having.

    I already have code to read ID3v1 and v2 tags. That's not the problem. I open an IOStream, locate the ID3v2 header and pull the bytes out. Handling unicode was a bit of a sod, but I got it working.

    What I don't understand is how to remove an ID3v2 tag or write one out. ID3v1 is easy - just truncate the file, then append some bytes. Simple. But ID3v2 tags don't have to be at the start of the file, do they? It's conventional, but by no means mandatory. If I just crop the entire ID3 out of the file, and close the gap, will that work? And then, to write my own tags, should I just write the bytes to the front of the file? Or do I need to update other bits of the file so the player will know where the audio data has moved to?

    Also, do I need to use unsynchronisation? How can I tell if I need to?

    I've looked on CodeProject; I've googled; and I've read the specification on id3.org - which, by the way, is less than clear! For example, it says that the "Extended header size" can be 6 or 10 bytes in length. So um....how am I supposed to know which one? Is there some magic way of determining how many bytes this value is being stored as?

    So yeah... I'd appreciate a little help, guys.

    I'm an experienced coder btw, so please feel free to respond with advanced and complicated explanations if you so choose!

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: How to erase or write ID3v2 tags to MP3s

    I can't say but my advice would be to try it on a backup MP3 file and see what happens.
    Always use [code][/code] tags when posting code.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured