Working with mp3 files and folders.

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 1
Reputation: gisek is an unknown quantity at this point 
Solved Threads: 0
gisek gisek is offline Offline
Newbie Poster

Working with mp3 files and folders.

 
0
  #1
Nov 16th, 2008
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!
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 15
Reputation: james_zheng is an unknown quantity at this point 
Solved Threads: 0
james_zheng james_zheng is offline Offline
Newbie Poster

Re: Working with mp3 files and folders.

 
0
  #2
Nov 16th, 2008
the first 2 questions can be solved by the following sample code:
  1. find(char * lpPath)
  2. {
  3. char szFind[MAX_PATH];
  4. WIN32_FIND_DATA FindFileData;
  5.  
  6. strcpy(szFind,lpPath);
  7. strcat(szFind,"\\*.*");
  8.  
  9. HANDLE hFind=::FindFirstFile(szFind,&FindFileData);
  10. if(INVALID_HANDLE_VALUE == hFind) return;
  11.  
  12. while(TRUE)
  13. {
  14. if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
  15. {
  16. if(FindFileData.cFileName[0]!='.')
  17. {
  18. strcpy(szFile,lpPath);
  19. strcat(szFile,"\\");
  20. strcat(szFile,FindFileData.cFileName);
  21. find(szFile);
  22. }
  23. }
  24. else
  25. {
  26. cout << FindFileData.cFileName;
  27. }
  28. if(!FindNextFile(hFind,&FindFileData)) break;
  29. }
  30. FindClose(hFind);
  31. }
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum


Views: 323 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC