I am looking at Audio Unit Development Fundamentals. Assuming
UInt32 sessionCategory = kAudioSessionCategory_PlayAndRecord;
status = AudioSessionSetProperty(
kAudioSessionProperty_AudioCategory,
sizeof(sessionCategory),
&sessionCategory);
with sample rate 44,1000 and allocate the buffer large enough to hold 1 second recording
- How often the recording callback method will be called?
- Once per second?
- What’s the algorithm to decide to call the callback method?
Thanks in advance for your help
Assuming that you haven’t set the
kAudioUnitProperty_MaximumFramesPerSliceproperty on the Audio Unit in question, a render cycle will execute (thus calling your callback) once everyFRAMES_PER_SLICE / SAMPLE_RATEseconds. At 44.1kHz, and with the default maximum frames per slice of 1024, this works out to1024 / 44100, or~0.023 seconds / ~23 milliseconds. That’s just over 43 times per second.I’m not sure about your third question. Are you asking how the Audio Unit determines internally whether or not to call (one of) its callback(s)?