OK. This is C-style code. It gets the info at the end of the mp3 file marked
with the letters 'TAG'. Some of this may be truncated. I assume mfnm is an
AnsiString holding the name of the MP3 file.
FILE *fpj=fopen(mfnm.c_str(),"rb"); int nbry=0;
char btgf[130],sngnm[35],artst[35],albm[35],yur[5],cmmnt[35];
if (fpj)
{
if (fseek(fpj,-128,SEEK_END)==0)
nbry=fread(btgf,sizeof(char),128,fpj);
fclose(fpj);
}
if (nbry>0 && btgf[0]=='T' && btgf[1]=='A' && btgf[2]=='G')
{
strncpy(sngnm,&btgf[3],30*sizeof(char)); sngnm[30]='\0';
strncpy(artst,&btgf[33],30*sizeof(char)); artst[30]='\0';
strncpy(albm,&btgf[63],30*sizeof(char)); albm[30]='\0';
strncpy(yur,&btgf[93],4*sizeof(char)); yur[4]='\0';
strncpy(cmmnt,&btgf[97],30*sizeof(char)); cmmnt[30]='\0';
}
HTH
--
Mark Jacobs
http://jacobsm.com
Also Maybe you can help me.
I have embedded WMP win media player on my form.
I cam play files fine. But I want to add media items to the media collection library
int sze;
sze = FileListBox1->Items->Strings[cnt].WideCharBufSize();
tmp = WideChar(FileListBox1->Items->Strings[cnt],sze);
MusicForm->WMP1->mediaCollection->add(tmp) ;
But the complier just complains that
[C++ Error] MusicPL.cpp(375): E2285 Could not find a match for 'IWMPMediaCollection::add(wchar_t)'
Do i have to create a new collection? All the examples Ive seen are in VB and look really simple I even just tried
MusicForm->WMP1->mediaCollection->add("c:\filex.mp3); // just like vb example
and it didnt work either?
Can anyone help?
Cheers
Brett
Have a look at the thread "iTunes ID3 Tag" in
Borland.Public.Delphi.Multimedia newsgroup. I put code to extract salient
details there.
>
> Also Maybe you can help me.
> I have embedded WMP win media player on my form.
> I cam play files fine. But I want to add media items to the media
> collection library
Sorry, I have never used this object. I use TMediaPlayer. Free app available
at http://www.jacobsm.com/mjsoft.htm#mjplyr