SwiftUI Preview turns on microphone

692 Views Asked by At

Does anyone know how to stop swiftUI previews from turning the microphone on? I wear bluetooth headphones while I work and every time a preview boots up it enables the mic. This degrades my audio quality since the headphones then split their bandwidth between playback and input.

My workaround has been to go into sound settings and just switch my default input to either my webcam or the macbook itself. It's so weird that the preview in xcode would turn on the mic every time it is enabled though.

Context: I have a MBP 2019 Xcode 12.4 Catalina

Thanks!

1

There are 1 best solutions below

0
On

I've found that the Xcode Previews like to fuss around with the coreaudiod deamon, causing all sorts of issues (mics going on, audio stuttering, duplicated output). Try to manually kill all of those deamons from the terminal level. Apps that need this daemon to work should automatically restart needed deamon instances on their own, while Xcode won't do this.

sudo kill -9 `ps ax|grep 'coreaudio[a-z]' | awk '{print $1}'`