Despite my best efforts I am still getting a light rattling distortion sound on my core audio app when recording with the 6s in speaker mode
I've read all the other posts on 6s 48000 mic issues and believe i am doing everything correctly - I'm setting up my graph and client formats correctly as far as I can tell , and not expecting a certain number of frames any where in my code
My app needs to use core audio run at 44,100 because it mixes the live mic with sampled content that is 44100.0
It also needs to have the AVAudioSessionCategoryOptionDefaultToSpeaker flag set because it monitors audio out of the speakers when the mic is off
Here is a scaled down example - I'm connection the remoteIO input -> mixer -> remoteIO in typical fashion and setting the stream formats here is what my initialized running augraph looks like in the console
AudioUnitGraph 0x599000:
Member Nodes:
node 2: 'auou' 'rioc' 'appl', instance 0x136fbafc0 O I
node 3: 'aumx' 'mcmx' 'appl', instance 0x13803ce00 O I
Connections:
node 2 bus 1 => node 3 bus 0 [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
node 3 bus 0 => node 2 bus 0 [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
CurrentState:
mLastUpdateError=0, eventsToProcess=F, isInitialized=T, isRunning=T (1)
I record my file inside a render callback using ExtAudioFileWriteAsync attached to the mixer I set my client format propertly to 44100.0
OSStatus nCallback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inbusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData) {
Engine *This = (__bridge Engine*)inRefCon;
if(!(*ioActionFlags & kAudioUnitRenderAction_PreRender)) {
ExtAudioFileWriteAsync(This->_EAFR, inNumberFrames, ioData);
return noErr;
}
I've tried attatching the callback to the mixer output as well as the output remote io and the client format set correctling and the resulting file still contains the light crackling sound on the 6s
Here is the crazy part - which is possibly a red herring - If i remove the AVAudioSessionCategoryOptionDefaultToSpeaker flag my resulting recordings are fine. I'm out of ideas to try. Thanks!