Re: ExtAudioFileSetProperty ClientDataFormat error on iPhone
Re: ExtAudioFileSetProperty ClientDataFormat error on iPhone
- Subject: Re: ExtAudioFileSetProperty ClientDataFormat error on iPhone
- From: Doug Wyatt <email@hidden>
- Date: Mon, 12 Oct 2009 08:25:19 -0700
AudioConverter doesn't support floating point formats on iPhoneOS.
On Oct 11, 2009, at 22:31 , tahome izwah wrote:
Hi all
I am getting a 'fmt?' error from ExtAudioFileSetProperty on the device
when trying to set kExtAudioFileProperty_ClientDataFormat with the
following ASBD:
AudioStreamBasicDescription clientFormat;
propSize = sizeof(clientFormat);
memset(&clientFormat, 0, sizeof(AudioStreamBasicDescription));
clientFormat.mFormatID = kAudioFormatLinearPCM;
clientFormat.mSampleRate = sampleRate;
clientFormat.mFormatFlags = kAudioFormatFlagIsFloat |
kAudioFormatFlagIsPacked | kAudioFormatFlagsNativeEndian;
clientFormat.mChannelsPerFrame = numChannels;
clientFormat.mBitsPerChannel = sizeof(float) * 8;
clientFormat.mFramesPerPacket = 1;
clientFormat.mBytesPerFrame = clientFormat.mBitsPerChannel *
clientFormat.mChannelsPerFrame / 8;
clientFormat.mBytesPerPacket = clientFormat.mFramesPerPacket *
clientFormat.mBytesPerFrame;
clientFormat.mReserved = 0;
err = ExtAudioFileSetProperty(extAFRef,
kExtAudioFileProperty_ClientDataFormat, propSize, &clientFormat);
if (err) {NSLog(@"!!! Error in ExtAudioFileSetProperty, %d", err);
return err;}
This works fine on the simulator. I'm on iPhone OS 2.0. According to
the documentation, kAudioFormatFlagIsFloat is supported on iPhone 2.0
and later, so I guess it must be something else. The file I'm trying
to read is 16bit mono AIFF @ 44.1kHz, uncompressed.
Any help would be greatly appreciated!
_______________________________________________
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