• 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
RE: ExtAudioFileSetProperty( kExtAudioFileProperty_FileDataFormat ) returns error 1718449215
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: ExtAudioFileSetProperty( kExtAudioFileProperty_FileDataFormat ) returns error 1718449215


  • Subject: RE: ExtAudioFileSetProperty( kExtAudioFileProperty_FileDataFormat ) returns error 1718449215
  • From: "Andrew E. Davidson" <email@hidden>
  • Date: Thu, 6 Aug 2009 12:09:06 -0700

Hi Bill

Thanks. I now understand why I could convert PCM to AAC in the simulator but
on the iPhone. I really do not care which format I convert to. My goal is to
compress the file into something that most clients can play back. What
format would you recommend?

I tried using MP3 but could not even get this to work in the simulator.
Setting the client data format fails with 1718449215 (format error)

Here is my input format
inputFormat.mSampleRate = self.hardwareSampleRate  / 4.0;
inputFormat.mFormatID = kAudioFormatLinearPCM;
inputFormat.mChannelsPerFrame = 1;
inputFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger |
	audioFormatFlagIsPacked;
inputFormat.mFramesPerPacket	= 1;
inputFormat.mBitsPerChannel = 16;
inputFormat.mBytesPerPacket	= 2;
inputFormat.mBytesPerFrame	= 2;

am I setting up the mFormatFlags incorrectly when I record? I copied these
setting from the speakHere sample app.

here is how I am setting up the output format for mp3. I used
/usr/bin/afinfo and the debugger to look at settings for mp3 files in iTunes

outputFormat.mSampleRate = inputFormat.mSampleRate
outputFormat.mFormatID = kAudioFormatMPEGLayer3;
outputFormat.mChannelsPerFrame = input.mChannelsPerFrame;
outputFormat.mFormatFlags =  inputFormat.mFormatFlags;
outputFormat.mFramesPerPacket	= 1152;
outputFormat.mBitsPerChannel = 0;
outputFormat.mBytesPerPacket	= 0;
outputFormat.mBytesPerFrame	= 0;

ExtAudioFileCreateWithURL(outURL, kAudioFileMP3Type,  outputFormat, ...)
ExtAudioFileSetProperty(outputFile, kExtAudioFileProperty_ClientDataFormat,
size, &inputFormat);

Any idea what I am doing wrong?
I looked at /Developer/Examples/CoreAudio/SimpleSDK/ it is pretty hard to
understand.

Thanks

Andy
________________________________

Replace Ads with your Stuff! Learn how @  www.prowebsurfer.com
> -----Original Message-----
> From: William Stewart [mailto:email@hidden]
> Sent: Thursday, August 06, 2009 10:55 AM
> To: Andrew E. Davidson
> Cc: email@hidden
> Subject: Re: ExtAudioFileSetProperty( kExtAudioFileProperty_FileDataFormat
> ) returns error 1718449215
>
> so... the examples in /Developer/Examples/CoreAudio/SimpleSDK/
> ConvertFile can help you to understand what goes in in ExtAudioFile,
> which does a number of things, but in this particular case, it pairs
> an audio file to an audio converter. There are two sides to the format
> that ExtAF deals with - the client format (which can either be the
> exact format of what is in the file, or linear pcm as a "canonical
> version" - which is float32 on the desktop) and the file format, which
> is the format of the data in the file.
>
> Any difference between the file format and the client format implies
> the construction of an audio converter that will convert between the
> two formats. In the case below, you have a linear pcm client format,
> and AAC file format - so you get an audio converter that will do an
> AAC encoding. On the phone in the 3.0 software, there is NO support
> for an AAC encoder beyond use of it in an AudioQueue (input only), so
> that is your error.
>
> So, this is a limitation in the 3.0 software (otherwise everything
> that you are doing is correct)
>
> Bill
>
> On Aug 5, 2009, at 3:24 PM, Andrew E. Davidson wrote:
>
> > Formatting is still mixed up? What I see is not what you get
> >
> > Hi
> >
> > I am trying to use ExtAudioFile to convert a PCM file I create on
> > the iphone
> > using Audio Queues into a compressed format (AAC)
> >
> > For some unknown reason I getting 17184492215 error when I try to set
> > kExtAudioFileProperty_ClientDataFormat.
> >
> > Could this have something do with the way I set up the recording
> > format?
> > here is how I set the recording format
> >
> > audioFormat.mSampleRate = self.hardwareSampleRate  / 4.0;
> > audioFormat.mFormatID = kAudioFormatLinearPCM;
> > audioFormat.mChannelsPerFrame = 1;
> > audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger |
> > audioFormatFlagIsPacked;
> > audioFormat.mFramesPerPacket	= 1;
> > audioFormat.mBitsPerChannel = 16;
> > audioFormat.mBytesPerPacket	= 2;
> > audioFormat.mBytesPerFrame	= 2;
> >
> > here is my code
> > ExtAudioFileOpenURL ( inputURL, &audioSourceFile);
> > ExtAudioFileGetProperty ( audioSourceFile,
> > kExtAudioFileProperty_FileDataFormat, ...)
> >
> > Copy the input format to the output
> > outputFormat.mFormatID = kAudioFormatMPEG4AAC;
> >
> > ExtAudioFileGetPropertyInfo( audioSourceFile,
> > kExtAudioFileProperty_FileChannelLayout ...)
> >
> > ExtAudioFileCreateWithURL(outURL, kAudioFileM4AType,
> > outputFormat, ...)
> >
> > ExtAudioFileSetProperty(outputFile,
> > kExtAudioFileProperty_ClientDataFormat,
> > size, &audioSourceFormat);
> >
> >
> > Any idea what I am doing wrong?
> >
> > Thanks
> >
> > andy
> >
> > _______________________________________________
> > 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
>



 _______________________________________________
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

References: 
 >RE: ExtAudioFileSetProperty( kExtAudioFileProperty_FileDataFormat ) returns error 1718449215 (From: "Andrew E. Davidson" <email@hidden>)
 >Re: ExtAudioFileSetProperty( kExtAudioFileProperty_FileDataFormat ) returns error 1718449215 (From: William Stewart <email@hidden>)

  • Prev by Date: Re: Wrapper class for Cocoa Audio Units in Carbon Hosts
  • Next by Date: Re: Questions regarding output from afinfo
  • Previous by thread: Re: ExtAudioFileSetProperty( kExtAudioFileProperty_FileDataFormat ) returns error 1718449215
  • Next by thread: Re: ExtAudioFileSetProperty( kExtAudioFileProperty_FileDataFormat ) returns error 1718449215
  • Index(es):
    • Date
    • Thread