Re: AudioFile and m4a
Re: AudioFile and m4a
- Subject: Re: AudioFile and m4a
- From: William Stewart <email@hidden>
- Date: Tue, 24 May 2005 16:48:07 -0700
Its a feature of the property info we didn't implement
We wouldn't fix this in a Tiger SU, but we will consider fixing this
for a later OS Release (though I don't know if that would help you).
I wonder if you can call through to the Spotlight importer here to
get the information for file types where this property isn't
supported (This might be true of other file types as well, so it
would be a good backup case to have generally - we could help sort
this out for you)
Bill
On 24/05/2005, at 7:58 AM, Martin Hairer wrote:
Hi, I tried to use the kAudioFilePropertyInfoDictionary property to
retrieve metadata
from an m4a file. It seems to work fine for AIFF files, but I get a
pty? error when trying
the same piece of code on an m4a file created with iTunes. I added
the following piece
of code (taken from a post on this list) at the end of the "afinfo"
sample code:
OSStatus result;
UInt32 dataSize;
result = AudioFileGetPropertyInfo (afid,
kAudioFilePropertyInfoDictionary, &dataSize, NULL);
if (result == noErr)
{
CFMutableDictionaryRef myDictionary = NULL;
result = AudioFileGetProperty(afid,
kAudioFilePropertyInfoDictionary, &dataSize, &myDictionary);
if (result == noErr)
{
CFStringRef artistString = NULL;
if (CFDictionaryGetValueIfPresent(myDictionary, CFSTR
(kAFInfoDictionary_Artist), (const void **) &artistString))
{
char artist[512];
CFStringGetCString(artistString, artist, 512,
kCFStringEncodingUTF8);
printf("Artist is '%s'\n", artist);
}
CFRelease(myDictionary);
}
} else
printf("AudioFileGetPropertyInfo
kAudioFilePropertyInfoDictionary failed with error %4.4s\n", (char*)
&result);
When typing "afinfo XXXX.m4a" in the terminal, I get the following
output:
File: XXXX.m4a
File type ID: m4af
Data format: 2 ch, 44100 Hz, 'aac ' (0x00000002) 0 bits/
channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
Channel layout: Stereo (L R)
audio bytes: 1546537
audio packets: 4161
duration: 96.6182 seconds
maximum packet size: 541
AudioFileGetProperty kAudioFilePropertyDataOffset failed for
'XXXX.m4a'
optimized
AudioFileGetPropertyInfo kAudioFilePropertyInfoDictionary failed
with error pty?
Is there something I am doing wrong here? If not, is this a bug
and will it be fixed in an upcoming
release? Regards,
Martin
HairerSoft
http://www.hairersoft.com/
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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