Click here to Skip to main content
11,647,037 members (79,388 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C
greetings,
i want to make a program for editing the id3tag for a mp3 file.
i would like to know , about what all topics do i need to study to implement such a program. i know how to program in c and c++ but to the extent they teach at college level(not very very much).





thank you.

[edit reason="Moved from comment"]
I FOUND THIS CODE ON THE NET..... DOESNT RUN ON MY PC... COULD YOU TELL ABOUT THE LIBRARIES USED....
#include<iostream>
#include<stdio.h>

/*taglib specific includes*/
#include<tbytevector.h>//ByteVector
#include<mpegfile.h>//mp3 file
#include<id3v2tag.h>//tag
#include<id3v2frame.h>//frame
#include <attachedpictureframe.h>//attachedPictureFrame

using namespace std ;
using namespace TagLib::ID3v2 ;
 
int main(int argc, char * argv[])
{
    if(argc !=2)
    {
        cout<<"usage: drag an mp3 file on to the program and it will extract the attached image"<<endl<<endl;
        system("pause");//on linux you can replace this with cin.get()
        exit(1);
    }
 
    TagLib::MPEG::File mp3File(argv[1]);
    Tag * mp3Tag;
    FrameList listOfMp3Frames;
    AttachedPictureFrame * pictureFrame;
 
    mp3Tag= mp3File.ID3v2Tag();
    if(mp3Tag)
    {
        listOfMp3Frames = mp3Tag->frameListMap()["APIC"];//look for picture frames only
        if(!listOfMp3Frames.isEmpty())
        {
            FrameList::ConstIterator it= listOfMp3Frames.begin();
            for(; it != listOfMp3Frames.end() ; it++)
            {
                pictureFrame = static_cast<attachedpictureframe> (*it);//cast Frame * to AttachedPictureFrame*

                //Warning. format of picture assumed to be jpg. This may be false, for example it may be png.
                FILE * fout;
                fopen_s(&fout, "outputFile.jpg", "wb");
                cout<<"processing the file "<< argv[1] <<endl<<endl;
                fwrite(pictureFrame->picture().data(), pictureFrame->picture().size(), 1, fout);
                fclose(fout);
                cout<<" The picture has been written to \t outputFile.jpg  \nRemember that the file type .jpg is just assumed for simplicity"<<endl<<endl;
            }
        }
        else cerr<<"there seem to be no picture frames (APIC) frames in this file"<<endl<<endl;
    }
    else cerr<<"the file "<<argv[1]<<"does not appear to have any mp3 tags"<<endl<<endl;
 
    system("pause");//on linux you can replace this with cin.get()
    return 0;
}

[edit]
Posted 5-Jan-13 1:15am
Edited 5-Jan-13 2:25am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Assuming your C++ skills are up to it then you just need to study MP3 file formats[^] to see what information is held in them.
  Permalink  
Comments
KRYPTONIAN1111 at 5-Jan-13 7:57am
   
Comment moved to Original question.
Richard MacCutchan at 5-Jan-13 8:28am
   
Sorry I have no idea what libraries it may use. If you "found some code on the internet" do not be surprised if it does not work. Go back where you found it and ask the person who posted it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 jyo.net 510
1 Sergey Alexandrovich Kryukov 423
2 OriginalGriff 398
3 CPallini 339
4 DamithSL 300
0 OriginalGriff 1,253
1 jyo.net 994
2 DamithSL 896
3 Sergey Alexandrovich Kryukov 833
4 CPallini 720


Advertise | Privacy | Mobile
Web02 | 2.8.150804.2 | Last Updated 5 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100