AudioFile and
AudioFile and
- Subject: AudioFile and
- From: Martin Hairer <email@hidden>
- Date: Tue, 24 May 2005 15:58:58 +0100
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