• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MDItemCopyAttributes replacement for audio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: MDItemCopyAttributes replacement for audio
      • From: Kyle Sluder <email@hidden>
References: 
 >MDItemCopyAttributes replacement for audio (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: MDItemCopyAttributes replacement for audio (From: Jens Alfke <email@hidden>)

  • Prev by Date: SKIndexAddDocument crashing
  • Next by Date: Re: MDItemCopyAttributes replacement for audio
  • Previous by thread: Re: MDItemCopyAttributes replacement for audio
  • Next by thread: Re: MDItemCopyAttributes replacement for audio
  • Index(es):
    • Date
    • Thread