I have a RemoteIO unit setup that gets input from microphone and plays it. The playback can be enabled or disabled anytime with a tap of a button. My question is does the call to enable or disable playback requires audio unit to stop, uninitialize and then configure or stopping & uninitializing is not required at all? This is the sample code I use to enable or disable playback at runtime when RIO is running.
/* Are these two lines required or not???*/
[self stopIOUnit];
AudioUnitUninitialize(mAudioUnit);
int flag = enable? 1 : 0;
// play on io on the output bus
OSStatus status = AudioUnitSetProperty(mAudioUnit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Output,
0, /*output*/
&flag,
sizeof(flag));