AVAudioEngine input on Mac, disrupting low priority sounds

I am analysing sounds by tapping the mic on the Mac.

All is working well, but it disrupts other (what I assume) are low priority sounds e.g. dragging an item off the dock, sending a message is messages, speaking something in Shortcuts or Terminal. Other sounds like music.app playing, Siri speaking are not disrupted. The disruption sounds like the last part of the sound being repeated two extra times, very noticeable. This is the code:

import Cocoa
import AVFAudio

class AudioHelper: NSObject {
    let audioEngine = AVAudioEngine()

    
    func start() async throws {

        
        audioEngine.inputNode.installTap(onBus: 0, bufferSize: 8192, format: nil) { buffer, time in
 
        }
        
        try audioEngine.start()
    }
}

I have tried increasing the buffer, changing the qos to utility (in the hope the sound analysis would become less important than the disrupted sounds),running on a non-main thread, but no luck. MacOS 13.4.1

Any assistance would be appreciated.

I tried the code to start an engine here: https://developer.apple.com/documentation/soundanalysis/classifying_sounds_in_an_audio_stream If anyone can confirm that: say "hello" in the terminal stutters with an audio engine running it would be good to know.

Can confirm, seeing the same thing, on 13.4 (22F66).

AVAudioEngine input on Mac, disrupting low priority sounds
 
 
Q