• 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
AudioFileCountUserData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AudioFileCountUserData


  • Subject: AudioFileCountUserData
  • From: Chris Adamson <email@hidden>
  • Date: Thu, 22 Jan 2009 14:54:27 -0500

I've noticed that getting artist/album/title metadata from audio files via AudioFileGetPropertyInfo / AudioFileGetProperty works for .mp3's (in that getting the kAudioFilePropertyInfoDictionary property returns a CFDictionaryRef with non-trivial data), but not for iTunes .m4a's, for which the dictionary contains only an approximate duration.

I noticed the user data functions, and wondered if those might be where I could find this metadata for an .m4a, analogous to the user data atom of a QuickTime file.

Thing is, I don't see any examples that use the user data functions, or a list of what four-char-codes might be amenable to them... which probably makes sense if the user data 4ccs are format dependent.

The other problem is that the call to AudioFileCountUserData isn't even working for me.  I took a shot in the dark and tried to get the 4cc that iTunes uses for track number:

// debug - look at user data
UInt32 item4CC = 'trkn';
UInt32 itemCount = 0;
err = AudioFileCountUserData
(audioFile,
item4CC,
&itemCount);
if (err == noErr)  {
NSLog (@"Got %d user data items");
} else {
CFErrorRef error = CFErrorCreate(NULL, kCFErrorDomainOSStatus, err, NULL);
NSLog (@"Error: %@", error);
CFRelease (error);
}



The result is an error:

2009-01-22 14:35:55.654 SimpleAudioPlayer[3531:20b] Error: Error Domain=NSOSStatusErrorDomain Code=1869627199 UserInfo=0x52c5b0 "Operation could not be completed. (OSStatus error 1869627199.)"

Any suggestions are welcome.  This is on iPhone, but I'm broadly interested in mastering the Audio File * APIs on both iPhone and Mac.

--Chris

BTW, while I'm being a nuisance... I could swear there's a CF function that lets you pass in a 4CC as a string and returns you a UInt32.  Is there such a thing?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: AudioFileCountUserData
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Slow seeking in MP3 files using ExtAudioFile
  • Next by Date: Re: Slow seeking in MP3 files using ExtAudioFile
  • Previous by thread: Re: Writing .m4a files using ExtAudioFile?
  • Next by thread: Re: AudioFileCountUserData
  • Index(es):
    • Date
    • Thread