views:

51

answers:

3

How can I get album artwork, song name, album name and artist name from an audio file? I need to display this without the use of iTunes. Thanks.

A: 

The QuickTime APIs support that, but they aren't ObjC. It'll still work fine though.

http://developer.apple.com/library/mac/#qa/qa2001/qa1135.html

Marc W
A: 

Part of my SFBAudioEngine framework supports reading and writing metadata for AIFF, WAVE, AAC, Apple Lossless, MP3, FLAC, Vorbis, Musepack and WavPack. The code is C++ and BSD licensed.

AFAIK there is no native support for reading/writing FLAC metadata (or FLAC audio for that matter) in OS X.

sbooth
No MP3? Oh, and I am writing a Cocoa application. I can't use C++ with Carbon since my application in 64 bits.
Time Machine
Sorry, left that one out by mistake- MP3 is supported! I edited appropriately.
sbooth
A: 

If the file has been indexed by Spotlight, you can use the Metadata framework to examine it. Create an MDItem for the file, then ask it for the attributes you're interested in.

The attributes of a song are:

  • kMDItemTitle
  • kMDItemAuthors (Artist(s)—value is an array of strings)
  • kMDItemAlbum

For the album art, you'll need to request a thumbnail image for the file from Quick Look. This isn't foolproof, but should work on most systems, as long as the Quick Look generator for audio files uses the album art if present.

Peter Hosey