• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AAC Audio Encoding with AudioConverter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: AAC Audio Encoding with AudioConverter?
      • From: James McCartney <email@hidden>
  • Prev by Date: Re: Writing Virtual Audio Devices
  • Next by Date: Re: AAC Audio Encoding with AudioConverter?
  • Previous by thread: Re: Writing Virtual Audio Devices
  • Next by thread: Re: AAC Audio Encoding with AudioConverter?
  • Index(es):
    • Date
    • Thread