Re: MDItemCopyAttributes replacement for audio
Re: MDItemCopyAttributes replacement for audio
- Subject: Re: MDItemCopyAttributes replacement for audio
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Wed, 06 Nov 2013 13:29:32 +0700
On 6 Nov 2013, at 01:57, Jens Alfke <email@hidden> wrote:
>
> On Nov 5, 2013, at 9:49 AM, Gerriet M. Denkmann <email@hidden> wrote:
>
>> Maybe Spotlight refuses to index app contents.
>
> Right.
>
>> So: how can I get this information directly from the sound files?
>> I found some references to QuickTime and Audio Toolbox, but all this is deprecated.
>> What is the current replacement?
>
> Use AVFoundation — it has some easy APIs to get this kind of metadata from audio files.
Works fine. Thank you (both) very much.
AVMetadataItem *ai = avaAsset.commonMetadata[ i ];
My sound files all have [ ai.keySpace isEqualToString: AVMetadataKeySpaceiTunes ] = YES.
Using [ ai.commonKey isEqualToString: AVMetadataCommonKeyTitle ] works fine.
But how is one supposed to use "key"?
id aikey = ai.key; // is NSNumber - not documented
OSType hfsFileTypeCode = [ aikey unsignedIntValue ];
NSString *ke1 = NSFileTypeForHFSTypeCode ( hfsFileTypeCode ); // not documented either
But this gives ke1 = '©nam', not quite the same as AVMetadataiTunesMetadataKeySongName which is "@nam".
Without some function like: isEqual( key, AVMetadataiTunesMetadataKeySongName ) this property seems to be quite useless.
Kind regards,
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden