SimplyCoreAudio
SimplyCoreAudio copied to clipboard
Works the reverse way when AirPods are connected
My Stack looks like:
ZStack{
Text("Some Text Here")
.font(.custom("Impact", size: isMuted ? 50 : 90))
}
and i'm listening for output device changes like this:
.onReceive(NotificationCenter.default.publisher(for: .defaultOutputDeviceChanged)){ _ in
if let outputDevice = simplyCA.defaultOutputDevice {
if outputDevice.name.contains("AirPods") {
isAirPodsConnected = true
} else {
isAirPodsConnected = false
}
}
}
The problem is when i connect my Airpods, the isMuted variable is triggered as true (but still able to hear sound). Only when Airpods are connected!! This make the text appear small, big when the volume change but goes back to small after no time... and if really muted, the text appear as big... it works the reverse way...
What i'm doing wrong? Thanks.
Os: Ventura 13.6.1 MBA M2 - AirPods 3