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:

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?
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.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

On Jun 6, 2019, at 5:19 AM, Dave <dave@...> wrote:

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




Dave
 

Hi,

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:

AudioToolbox, especially Audio File Services (don’t have links but should be able to search docs easily), appear to have this capability.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

On Jun 6, 2019, at 5:19 AM, Dave <dave@...> wrote:

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






Jon Gotow
 

On Jun 6, 2019, at 9:04 AM, Dave <dave@...> wrote:

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?
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.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

On Jun 6, 2019, at 9:04 AM, Dave <dave@...> wrote:

Hi,

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:

AudioToolbox, especially Audio File Services (don’t have links but should be able to search docs easily), appear to have this capability.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

On Jun 6, 2019, at 5:19 AM, Dave <dave@...> wrote:

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








 

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.

—Jens

On Jun 6, 2019, at 3:36 AM, Keary Suska <cocoa-dev@...> wrote:

AudioToolbox, especially Audio File Services (don’t have links but should be able to search docs easily), appear to have this capability.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

On Jun 6, 2019, at 5:19 AM, Dave <dave@...> wrote:

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






Keary Suska
 

Rumor (i.e. Stack Overflow) has it that AVFoundation will only work with AAC, but I have not confirmed that myself.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

On Jun 9, 2019, at 12:38 PM, Jens Alfke <jens@...> 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.

—Jens

On Jun 6, 2019, at 3:36 AM, Keary Suska <cocoa-dev@...> wrote:

AudioToolbox, especially Audio File Services (don’t have links but should be able to search docs easily), appear to have this capability.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

On Jun 6, 2019, at 5:19 AM, Dave <dave@...> wrote:

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








 

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.)

—Jens

On Jun 9, 2019, at 11:14 AM, Keary Suska <cocoa-dev@...> wrote:

Rumor (i.e. Stack Overflow) has it that AVFoundation will only work with AAC, but I have not confirmed that myself.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

On Jun 9, 2019, at 12:38 PM, Jens Alfke <jens@...> 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.

—Jens

On Jun 6, 2019, at 3:36 AM, Keary Suska <cocoa-dev@...> wrote:

AudioToolbox, especially Audio File Services (don’t have links but should be able to search docs easily), appear to have this capability.

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

On Jun 6, 2019, at 5:19 AM, Dave <dave@...> wrote:

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