Date
1 - 9 of 9
How to get Extended File Info
Dave
Hi,
Looking at the Finder “Get Info” window, for instance for an mp3 file, it displays under the “More Info” tab, the Title, Authors, etc. How can I get this information programatically? Thanks a lot All the Best Dave |
|
Steve Mills
On Jun 6, 2019, at 06:19:26, Dave <dave@...> wrote:
Spotlight APIs can supply all that. -- Steve Mills Drummer, Mac geek |
|
Keary Suska
AudioToolbox, especially Audio File Services (don’t have links but should be able to search docs easily), appear to have this capability.
toggle quoted message
Show quoted text
Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" On Jun 6, 2019, at 5:19 AM, Dave <dave@...> wrote: |
|
Dave
Hi,
toggle quoted message
Show quoted text
I’m looking at the Audio Toolbox, I assume you mean the AudioOpenFile, AudioFileGetProperty and AudioCloseFile C functions? If so, then I can’t see how to get the fields I mentioned? In the Finder for MP3 files, it displays the Title, Album, Genre, etc. I don’t see a method that returns the same info? Spotlight, I can’t seem to find any reference to how to get this extended documentation any where. Surely then must be a Higher Level method to do this simple task? All the Best Dave On 6 Jun 2019, at 15:36, Keary Suska <cocoa-dev@...> wrote: |
|
Jon Gotow
On Jun 6, 2019, at 9:04 AM, Dave <dave@...> wrote:In Obj-C (getting width and height of an image in pixels): NSMetadataItem *mdItem = [[NSMetadataItem alloc] initWithURL:url]; NSDictionary *dict = [mdItem valuesForAttributes:@[NSMetadataItemPixelWidthKey, NSMetadataItemPixelHeightKey]]; - Jon |
|
Keary Suska
I believe there is a function where you can pull all available attributes/properties. You can look at that dict and see if it contains what you are looking for.
toggle quoted message
Show quoted text
Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" On Jun 6, 2019, at 9:04 AM, Dave <dave@...> wrote: |
|
AVFoundation has a higher-level OOP API for this. Look for methods for accessing metadata, and constants defining the various metadata types like Title, Artist, etc.
toggle quoted message
Show quoted text
—Jens On Jun 6, 2019, at 3:36 AM, Keary Suska <cocoa-dev@...> wrote: |
|
Keary Suska
Rumor (i.e. Stack Overflow) has it that AVFoundation will only work with AAC, but I have not confirmed that myself.
toggle quoted message
Show quoted text
Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" On Jun 9, 2019, at 12:38 PM, Jens Alfke <jens@...> wrote: |
|
No, I’ve used it with MP3 and AAC and AIFF; I’m pretty sure it supports every format there’s a system codec for (i.e. most audio formats except Ogg and FLAC, but you can get 3rd party components to do those.)
toggle quoted message
Show quoted text
—Jens On Jun 9, 2019, at 11:14 AM, Keary Suska <cocoa-dev@...> wrote: |
|