Hi,

Recently I came up with an idea of making my own program for tagging mp3 files. I realised I'm lacking in knowledge. For now I need the following information:

1. After typing a path to a main folder, I'd like to read the names of the folders inside.

2. Than I want to visit each of those folders - get inside (Those folders will include mp3 files).

3. Finally I want to enter this section of a mp3 file where the information about e.g. atrist or genre is kept and I want to chane it.

Can anyone help tell me with this?
Thanx!

the first 2 questions can be solved by the following sample code:

find(char * lpPath)
{
    char szFind[MAX_PATH];
    WIN32_FIND_DATA FindFileData;

    strcpy(szFind,lpPath);
    strcat(szFind,"\\*.*");

    HANDLE hFind=::FindFirstFile(szFind,&FindFileData);
    if(INVALID_HANDLE_VALUE == hFind)    return;
    
    while(TRUE)
    {
        if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
        {
            if(FindFileData.cFileName[0]!='.')
            {
                strcpy(szFile,lpPath);
                strcat(szFile,"\\");
                strcat(szFile,FindFileData.cFileName);
                find(szFile);
            }
        }
        else
        {
            cout << FindFileData.cFileName;
        }
        if(!FindNextFile(hFind,&FindFileData))    break;
    }
    FindClose(hFind);
}

the information on artist in a mp3 file is stored in the last 128 bytes of the file. so you can simply read the last 128 bytes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.