AAC Audio Encoding with AudioConverter?
AAC Audio Encoding with AudioConverter?
- Subject: AAC Audio Encoding with AudioConverter?
- From: email@hidden (Patrick Beard)
- Date: Thu, 16 Jan 2003 13:07:29 -0800
Is it possible to use the AudioConverter to convert 'pcm ' sound files
into AAC? There are AAC encoders out there, but it would be so much
nicer to use the built-in version if it is possible. Here's a snippet I
was working on, but the call to AuiodConverterNew returns the error
'fmt?':
// convert a sound file to AAC?
FSRef inputRef;
if (CFURLGetFSRef((CFURLRef)fileURL, &inputRef)) {
AudioFileID inputID;
if (AudioFileOpen(&inputRef, fsRdPerm, 0, &inputID) == noErr) {
AudioStreamBasicDescription inputFormat;
UInt32 propertySize = sizeof(inputFormat);
if (AudioFileGetProperty(inputID,
kAudioFilePropertyDataFormat, &propertySize, &inputFormat) == noErr) {
AudioStreamBasicDescription outputFormat = {
inputFormat.mSampleRate, kAudioFormatMPEG4AAC, kAACObject_LTP };
FSRef parentRef;
if (FSGetCatalogInfo(&inputRef, kFSCatInfoNone, NULL,
NULL, NULL, &parentRef) == noErr) {
FSRef outputRef;
AudioFileID outputID;
if (AudioFileCreate (&parentRef,
CFSTR("Converted.aiff"), kAudioFileAIFCType,
&outputFormat, 0, &outputRef,
&outputID) == noErr) {
AudioConverterRef converter;
if (AudioConverterNew(&inputFormat,
&outputFormat, &converter) == noErr) {
AudioConverterDispose(converter);
}
AudioFileClose(outputID);
}
}
}
AudioFileClose(inputID);
}
}
Do I simply need to upgrade to Quicktime Pro to be able to use the AAC
encoder? Or is there a different API I should be using?
- Patrick
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.