Switch to audio playback macro
Switch to audio playback macro
You can try tools that let you map devices to keys, such as Synapse 2 or other automation software. Look for options to assign audio playback functions to specific switches.
I utilize "autohotkey." Now you can press F6 to switch to headphones and F7 to switch to speakers. Let me know if you need further assistance!