• 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
ExtAudioFile format conversion (iPhone OS)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ExtAudioFile format conversion (iPhone OS)


  • Subject: ExtAudioFile format conversion (iPhone OS)
  • From: Chris Adamson <email@hidden>
  • Date: Sun, 8 Feb 2009 09:39:29 -0500

I'm working on understanding just what I can do with Audio Conversion Services on the iPhone, so I took an Audio Queue Services app that records the user in 44.1 KHz and tried to add a method to use an extended audio file to convert formats.

My conversion routine is heavily based on the UseExtAF class in the ConvertFile example in the CoreAudio SDK, and I'm trying to convert to Apple Lossless, which I thought would work because I can use 44.1 KHz Lossless as an ASBD for recording, and it works great.

What I'm seeing is that when I try to fill out the ASBD for the output:

convertedStreamDesc.mSampleRate = 44100.0;
convertedStreamDesc.mFormatID = kAudioFormatAppleLossless;
convertedStreamDesc.mChannelsPerFrame = 1;

// try to fill out this asbd
UInt32 convertedStreamDescSize = sizeof (convertedStreamDesc);
conversionErr =
AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, // inProperrtyId
0, // inSpecifierSize
NULL, // inSpecifier
&convertedStreamDescSize, // ioPropertyDataSize
&convertedStreamDesc); // outPropertyData
if (conversionErr != noErr) {
[self failTo: @"AudioFormatGetProperty" withOSStatus: conversionErr];
return;
}

I fail at to get the property, with kAudioDeviceUnsupportedFormatError:
Error in AudioFormatGetProperty: Error Domain=NSOSStatusErrorDomain Code=560226676 "Operation could not be completed. (OSStatus error 560226676.)"

Is there something else I need to do to set up the ASBD?  When I used lossless for recording, I only set these three parameters (formatter, channels, sample rate) and it was fine.  Or am I just doing it wrong?

Thanks in advance for any suggestions.

--Chris

 _______________________________________________
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

  • Follow-Ups:
    • Re: ExtAudioFile format conversion (iPhone OS)
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: Segmentation Fault when converting 24bit aif to alac with afconvert
  • Next by Date: How to configure AudioConverter to write VBR?
  • Previous by thread: Re: iPhone feedback problem
  • Next by thread: Re: ExtAudioFile format conversion (iPhone OS)
  • Index(es):
    • Date
    • Thread