Thread View: borland.public.cppbuilder.multimedia
4 messages
4 total messages
Started by Jim Davis
Wed, 05 Sep 2007 04:37
MP3 tag code ?
Author: Jim Davis
Date: Wed, 05 Sep 2007 04:37
Date: Wed, 05 Sep 2007 04:37
2 lines
798 bytes
798 bytes
Seeking C or C++ source to read *.MP3 ID3v2 tags
Re: MP3 tag code ?
Author: Mark Jacobs
Date: Sat, 22 Sep 2007 11:11
Date: Sat, 22 Sep 2007 11:11
30 lines
2119 bytes
2119 bytes
"Jim Davis" <jim46dd@hotmail.com> wrote in message
news:Xns99A1DC0C76EA7jim46ddhotmailcom@207.105.83.66...
> Seeking C or C++ source
> to read *.MP3 ID3v2 tags
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
Re: MP3 tag code ?
Author: Brett
Date: Wed, 14 Nov 2007 13:28
Date: Wed, 14 Nov 2007 13:28
65 lines
3145 bytes
3145 bytes
Hi,
Please email me for source of Id3v2.3 tag reading
My code is in BCB6 and also extracts embedded JPG album art out of the file
in my Mp3 ID3 files the tags are at the start of the file and each Tag has its own unique identifer,
I found that in my ID3v2.3 files the TAgs at the end are blank
So the below code would no work
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
"Mark Jacobs" <www.jacobsm.com/mjmsg.htm?Borland Newsgroup> wrote:
>"Jim Davis" <jim46dd@hotmail.com> wrote in message
>news:Xns99A1DC0C76EA7jim46ddhotmailcom@207.105.83.66...
>> Seeking C or C++ source
>> to read *.MP3 ID3v2 tags
>
>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
>
>
Re: MP3 tag code ?
Author: Mark Jacobs
Date: Fri, 16 Nov 2007 00:37
Date: Fri, 16 Nov 2007 00:37
24 lines
1929 bytes
1929 bytes
"Brett" <brett.kelly@austereo.com.au> wrote in message news:473b061f$1@newsgroups.borland.com... > Please email me for source of Id3v2.3 tag reading > My code is in BCB6 and also extracts embedded JPG album art out of the > file > in my Mp3 ID3 files the tags are at the start of the file and each Tag has > its own unique identifer, > I found that in my ID3v2.3 files the TAgs at the end are blank 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 -- Mark Jacobs http://jacobsm.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads