Re: MP3 info?
Re: MP3 info?
- Subject: Re: MP3 info?
- From: Lorenzo <email@hidden>
- Date: Sun, 27 Jul 2003 17:22:51 +0200
Thank you. Incredible. Sometimes the shortest ways don't come so easily...
Does this means that for any movie I have to alloc the memory for the whole
file? For example, if the MP3 file is long 4 MBytes, when I call
NSMovie *theMovie = [[[NSMovie alloc] initWithURL:movieURL
byReference:NO] autorelease];
does my application allocate 4MB? Or does it allocate only a pointer to the
data?
Best Regards
--
Lorenzo
email: email@hidden
>
From: John Anderson <email@hidden>
>
Date: Sun, 27 Jul 2003 09:10:41 -0700
>
To: Lorenzo <email@hidden>
>
Subject: Re: MP3 info?
>
>
Well if you're already linking against the Cocoa frameworks you can use:
>
>
NSURL *movieURL = [NSURL fileURLWithPath:@"/path/to/file"];
>
NSMovie *theMovie = [[[NSMovie alloc] initWithURL:movieURL
>
byReference:NO] autorelease];
>
UserData userData = GetMovieUserData(theMovie);
>
>
That's the fastest way to the user data anyway.
>
>
John
>
>
>
On Sunday, July 27, 2003, at 6:59 AM, Lorenzo wrote:
>
>
> Hi John,
>
> I took a look there and I found good code. Only, since I am totally
>
> new on
>
> this topic, I don't know how to get the parameter "theMovie" requested
>
> by
>
> the function there. I start with the pathname of a MP3 file (theItem),
>
> then
>
> once arrived to the point "OpenMovieFile" I get the error -2020 all the
>
> times, so I cannot go ahead. Can you help me please?
>
>
>
> - (NSMutableDictionary*)GetMetaDataFromFile:(NSString*)theItem
>
> {
>
> OSErr err;
>
> FSRef sourceRef;
>
> FSSpec sourceSpec;
>
>
>
> NSMutableDictionary *ID3Dict = nil;
>
> UserData userData = 0;
>
>
>
> err = FSPathMakeRef([theItem fileSystemRepresentation], &sourceRef,
>
> NULL);
>
> if(err) return nil;
>
>
>
> err = FSGetCatalogInfo(&sourceRef, kFSCatInfoNone, NULL, NULL,
>
> &sourceSpec, NULL);
>
> if(err) return nil;
>
>
>
> short nFileRefNum;
>
> Movie theMovie = nil;
>
> err = OpenMovieFile(&sourceSpec, &nFileRefNum, fsRdPerm);
>
> if(err) return nil; // it returns err = -2020 all the times
>
>
>
> short nResID = 0; //We want the first movie.
>
> Str255 strName;
>
> Boolean bWasChanged;
>
>
>
> err = NewMovieFromFile(&theMovie, nFileRefNum, &nResID, strName,
>
> newMovieActive, &bWasChanged);
>
> CloseMovieFile(nFileRefNum);
>
>
>
> userData = GetMovieUserData(theMovie);
>
> if(userData){
>
> err = PrintUserData(userData);
>
> }
>
> // other stuffs
>
>
>
> return nil;
>
> }
>
>
>
>
>
>
>
> Best Regards
>
> --
>
> Lorenzo
>
> email: email@hidden
>
>
>
>> From: John Anderson <email@hidden>
>
>> Date: Sat, 26 Jul 2003 20:05:16 -0700
>
>> To: Lorenzo <email@hidden>
>
>> Cc: email@hidden
>
>> Subject: Re: MP3 info?
>
>>
>
>> You can use the QuickTime APIs to access this as well...
>
>>
>
>> http://developer.apple.com/qa/qa2001/qa1135.html
>
>>
>
>> John
>
>>
>
>>
>
>> On Saturday, July 26, 2003, at 3:03 PM, Lorenzo wrote:
>
>>
>
>>> Hi,
>
>>> how to get info from an audio file (e.g. MP3)?
>
>>> I need to know, if available: Author, Album, Time, Title of the song,
>
>>> Genre,...
>
>>>
>
>>> Thank you.
>
>>>
>
>>> Best Regards
>
>>> --
>
>>> Lorenzo
>
>>> email: email@hidden
>
>>> _______________________________________________
>
>>> cocoa-dev mailing list | email@hidden
>
>>> Help/Unsubscribe/Archives:
>
>>> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
>>> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.