Re: MP3 info?
Re: MP3 info?
- Subject: Re: MP3 info?
- From: Lorenzo <email@hidden>
- Date: Mon, 28 Jul 2003 18:07:21 +0200
Hi,
I don't understand if you did a question or an answer.
I presume I should not open/read the movie file itself, and I hope to get
only the ID3 info. This should improve the speed.
Sincerely I don't understand why QT takes so long time (2 minutes to scan
1000 files). And all I did is the following.
///////////////////////////
NSURL *movieURL = [NSURL fileURLWithPath:theItem];
NSMovie *theMovie = [[NSMovie alloc] initWithURL:movieURL
byReference:YES];
UserData inUserData = GetMovieUserData([theMovie QTMovie]);
NSString *songName = [self GetField:kUserDataTextFullName ud:inUserData];
NSString *songArtist = [self GetField: kUserDataTextArtist ud:inUserData];
NSString *songAlbum = [self GetField: kUserDataTextAlbum ud:inUserData];
///////////////////////////
- (NSString*)GetField:(OSType)udType ud:(UserData)inUserData
{
OSErr err = noErr;
NSString *returnString = @"";
Handle hData = NewHandle(0);
char nul = 0;
err = GetUserDataText(inUserData, hData, udType, 1, langEnglish);
if(err == noErr){
PtrAndHand(&nul, hData, 1);
returnString = [NSString stringWithFormat:@"%s", *hData];
DisposeHandle(hData);
}
return returnString;
}
Anyway, speed a part, I still need to get the song duration (time), genre,
comment, ratings,...
>
> Anyway just to get ID3 songName, Artist, and Album of 1000 MP3 files
>
> using
>
> QT, my PowerBook Titanium 1GHz took about 2 minutes... It's incredibly
>
> too
>
> much! I supposed to spend 1 or 2 seconds... just as long the time I am
>
> used
>
> to spend to take info from the files like Type, Creator, Size, Flags,
>
> Permissions,...
>
>
Most of this file informations can be found without even touching the
>
file itself, as I suppose.
>
But isn't the ID3 information stored with the file's data, so to get
>
it, the file has to be opened/read/closed?
>
>
Maybe I'm wrong, though...
>
>
Greetings,
>
Dirk Stegemann
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.