Closed zhihaozhang closed 7 years ago
First of all do you use real mac or hackintosh? I think If you have hackintosh and implemented autoswitch with AppleHDA then device id should be the same cause connectors are in the same audio group. But it's not 100% info. You're free to test. If you find a solution - please share with us.
I'm using real mac. I tried my best to google an answer, but failed. Only one answer may be helpful, link: https://stackoverflow.com/questions/14483083/how-to-get-notifications-when-the-headphones-are-plugged-in-out-mac?s=1|1.3508 however, it seems to be out of date after OS X 10.9. Thank you for replying.
I cloned your code and find that before/after I plug in the headphone, the deviceID of Audio.getOutputDevices() is the same. How can I distinguish built-in audio and headphone? Thank you very much.