How to respect the silence switch

It seems that respecting the user's silence switch while using the microphone is essentially impossible. Is there anyway to do this with TAAE?

In didFinishLaunching I start TAAE like so

    AudioStreamBasicDescription streamFormat = [AEAudioController nonInterleaved16BitStereoAudioDescription];
    self.audioController = [[AEAudioController alloc] initWithAudioDescription:streamFormat options:(AEAudioControllerOptionDefaults)];
    [self.audioController setAudioSessionCategory:AVAudioSessionCategoryAmbient];
    [self.audioController setAutomaticLatencyManagement:YES];

…which respects the silence switch. Then when I need the microphone I currently change settings like this and just lose output rather than risk disrespecting the silence switch:

    streamFormat = [AEAudioController nonInterleaved16BitStereoAudioDescription];
    BOOL success = [self.audioController setAudioDescription:streamFormat inputEnabled:YES outputEnabled:NO error:&error];
    [self.audioController setUseMeasurementMode:YES];
Sign In or Register to comment.