ExtAudioFileSetProperty ClientDataFormat error on iPhone
ExtAudioFileSetProperty ClientDataFormat error on iPhone
- Subject: ExtAudioFileSetProperty ClientDataFormat error on iPhone
- From: tahome izwah <email@hidden>
- Date: Mon, 12 Oct 2009 07:31:00 +0200
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!
Thanks,
--th
_______________________________________________
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