Inconsistent ExtAudioFile API behavior between iPhone OS devices
Inconsistent ExtAudioFile API behavior between iPhone OS devices
- Subject: Inconsistent ExtAudioFile API behavior between iPhone OS devices
- From: Art Gillespie <email@hidden>
- Date: Mon, 15 Mar 2010 14:01:00 -0700
Hi Guys,
We're getting the strangest behavior when we try to set client format
on an ExtAudioFile. On some devices, this call returns noErr, and on
others, 'fmt?'
iPod Touch 1st Gen: 'fmt?'
iPod Touch 2nd Gen: noErr
iPhone 3G: 'fmt?'
iPhone 3GS: noErr
The code that sets up the AudioStreamBasicDescription is lifted
straight from CAStreamBasicDescription, so I'm at a loss. Help!
Code follows:
---
AudioStreamBasicDescription clientDescr; //input format
AudioStreamBasicDescription destDescr; //output format
memset(&clientDescr, 0, sizeof(clientDescr));
memset(&destDescr, 0, sizeof(destDescr));
// client description is the same regardless of whether we're doing aif or aac
// i.e., we're sending in 8.24 fixed-point
clientDescr.mFormatID= kAudioFormatLinearPCM;
clientDescr.mSampleRate= 44100.0;
clientDescr.mChannelsPerFrame= 2;
clientDescr.mBitsPerChannel= 32;
clientDescr.mBytesPerPacket= clientDescr.mBytesPerFrame= sizeof
(AudioUnitSampleType);
clientDescr.mFramesPerPacket= 1;
clientDescr.mFormatFlags= kAudioFormatFlagsCanonical |
(kAudioUnitSampleFractionBits << kLinearPCMFormatFlagsSampleFractionShift);
clientDescr.mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
<snip>set up destination format (m4a/aac)</snip>
AudioFileTypeID fileType = (asAAC)?kAudioFileM4AType:kAudioFileAIFFType;
OSStatus err= ExtAudioFileCreateWithURL( hurl, fileType, &destDescr,
NULL, kAudioFileFlags_EraseFile, &audioFile );
if( err != noErr ) { ZFAILASSERT(); return false; }
err = ExtAudioFileSetProperty(audioFile,
kExtAudioFileProperty_ClientDataFormat, sizeof(clientDescr),
&clientDescr);
_______________________________________________
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