AERecorder and TAAE > 1.5
Since upgrading to TAAE 1.5.1 I'm having problems with AERecorder. It worked fine before, but now it produces an empty audio file. On the console I am seeing the below errors. I have tried changing the audio description from nonInterleaved16BitStereoAudioDescription to nonInterleavedFloatStereoAudioDescription but it doesn't make any difference. Some help please?
TPCircularBuffer.c:97: Remap buffer memory: (os/kern) invalid argument
AEMixerBuffer.m:1042: AudioUnitSetProperty(kAudioUnitProperty_StreamFormat): -10868
Comments
A little bit further debugging shows the following: the crash occurs inside of the AEMixerBuffer setAudioDescription method. The first argument is a AudioStreamBasicDescription struct however all the fields are set to 0 for some reason.
That TPCircularBuffer error looks pretty serious - that's probably more indicative that there's a problem. If that's failing then...maybe something to do with word length? Is it a 64-bit build? Can you tell me a bit more about the environment? Can you reproduce this in the sample app at all?
This is in the iOS 9 iPad Air 2 Simulator. It's using Standard Architectures (including 64-bit). I tried the sample app and it works. Not sure what the problem is on my app, however:
The reason for the TPCircularBuffer error is because TPCircularBufferInit is being called with a bufferSize argument of 0.
That is caused by the audioDescription argument to AEMixerBuffer setAudioDescription having all fields set to 0.
This is further caused by AERecorder initWithAudioController calling *AEAudioControllerInputAudioDescription(audioController) which returns something with all fields 0.
If I replace *AEAudioControllerInputAudioDescription(audioController) with AEAudioStreamBasicDescriptionNonInterleaved16BitStereo or some other constant, then the TPCircularBuffer error goes away.
Maybe the problem is that AEAudioControllerInputAudioDescription returns a zeroed result since my app is not doing any audio input. The sample app uses AERecorder to do microphone recording so that might be why it works.
Aahhhhh!! Good sleuthing. Yeah, that could be a problem. Lemme sort that out.
Okay, try this: AERecorder.m:54, add "
audioController.inputEnabled &&
" to that if statementYep that fixed it.
Great. Committed.