Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kingsapo

macrumors member
Original poster
Jun 10, 2010
58
4
Hey all! This forum has never let me down before, so here's my question. I'm trying to make a basic app that will let you select a song (via a file-picker), play the song, and display some metadata (such as album, artist, etc.). I already have the file-picker setup, my need for help is in finding a framework that will allow for basic audio playback, and retrieval (and possibly editing) of metadata. Editing isn't a necessity, though it would be nice.

Sorry if this is kinda a noobie question, but I've done my research, gone through QTKit, OpenCL, and some other audio framework that I can't remember, and can't seem to find a clear answer on how, if possible, to retrieve metadata.

As usual, any help is greatly appreciated!
 

chown33

Moderator
Staff member
Aug 9, 2009
10,740
8,416
A sea of green
I don't know why you think OpenCL might have been relevant. AFAICT it has nothing to do with media or metadata.

ID3 is a common media metadata format. It was easy to find this:
http://id3lib.sourceforge.net/
using the search terms: mac os x id3 lib

If the file has been indexed by the Spotlight system:
http://developer.apple.com/library/...n/Conceptual/MetadataIntro/MetadataIntro.html
then you can also get its metadata using NSMetadataQuery (google it). That way you don't need to know what format the file is, nor what format its metadata is.

NSMetadataQuery will provide a single API regardless of how metadata is stored in the file, so I'd start with that first. If the desired data isn't returned in the result, only then resort to an ID3 lib and decoding the metadata yourself. Since the metadata might not be in ID3, letting Spotlight do the hard work will be the simplest thing that could possibly work, and that's almost always a good starting place.
 

kingsapo

macrumors member
Original poster
Jun 10, 2010
58
4
thanks, the NSMetadataQuery sounds better, considering I'll be developing this for the (to be released) Macintosh App Store, which, as far as I know, doesn't allow 3rd-party APIs, which id3lib is. I'll definitely look into NSMetadataQuery, thanks for the suggestion!
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
I'll be developing this for the (to be released) Macintosh App Store, which, as far as I know, doesn't allow 3rd-party APIs, which id3lib is.

I believe you can, you just can't install it as a framework/library into the user's computer. You'd have to bundle it with your .app as a framework/dylib (which you should do anyways).
 

kingsapo

macrumors member
Original poster
Jun 10, 2010
58
4
thanks, it's good to know I can use a 3rd party API if I bundle it within the app
 

kingsapo

macrumors member
Original poster
Jun 10, 2010
58
4
I don't know why you think OpenCL might have been relevant. AFAICT it has nothing to do with media or metadata.

Woops! I just realized that I meant OpenAL, not CL. I can see how that wouldn't make sense :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.