You don’t even need it to be as complex as that, I just have an aggregate device which only has the MacBook microphone input enabled and no outputs, then you set this as your _input_ device in Sound preferences, but leave the output device as is.
It’s easy to create the aggregate input device, go to the Audio MIDI Setup app, in the audio window click the plus in the bottom right and choose “new aggregate device”, then tick MacBook Microphone on the right. Then to System Preferences > Sound > Input and assign this new “virtual” device as your input device. (You can rename it if you want)
Now your Mac will automatically switch audio output source as usual, but the input remains locked to the microphone so you don’t get this annoying problem.
I was excited to try this, since I'm a bit tired of selecting the input manually multiple times per day. Unfortunately, connecting AirPods automatically switches the input to them, regardless of the previously selected input device, whether it's an aggregate device or not.
Hm let me double check on this tomorrow! It works with my Sony headphones (which also cause MacOS to go into bad audio mode when you eg launch Shazam) but not sure I have tried the same with AirPods. Unless I did something else to lock it to that device and I’ve forgotten… anyway I’ll check on my work machine tomorrow
What exactly is the logic osx is using here that causes non-aggregate input to always be switched when plugging in external source, but aggregate sources remain sticky?
If you option click on the speaker icon in the menu bar, you can select which input to use. Takes a second and works instead of needing an aggregate device set up.
That’s a good idea, I will consider it. Should check it how it works with AirPlay and continuity though. AirPods are not simple Bluetooth devices, strange things happen when connecting/disconnecting.