SwiftUI Preview turns on microphone
Asked Answered
T

1

12

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!

Tiu answered 2/2, 2021 at 17:32 Comment(2)
I can disable the Audio input of Simulator from Devices>IO but cannot find the option for canvas preview. Right now what I am doing is opening system preference> audio> and changing input to internal. That fixes it but I am also looking for a permanent solution.Dysphoria
Having the same issue. Ever found a real solution for this?Chrystel
S
4

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}'`
Swellfish answered 7/10, 2021 at 13:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.