Sound automation (headphones)

I have a headset that I use for gaming as well as video conferencing. It’s a Steelseries Arctis 7 wireless headset. It’s not Bluetooth and comes with a USB transmitter/receiver to interface with the Mac. When you plug in the receiver, the options to select the headset come up in the Sound preferences. This is regardless of whether the headset is turned on or off. So if I’ve been using it for videoconferencing and then turn the headset off, and then play song on iTunes, no sound comes out of the speakers of my Macbook because it’s technically playing the song through the USB receiver.

I’ve been manually having to go into Settings to change the input and output device every time and this is obviously ridiculous.

The workflow I’m trying to create probably looks something like this; and I don’t think will fully be able to be triggerable because I’m not sure what events I’m looking for, or whether those events are even detectable. So I’m resigned to go with a keyboard macro/toggle (possibly in Keyboard Maestro), but am still not entirely sure how I might still have some checks in it.

  1. Hit the button combo to execute the macro
  2. Detect whether the receiver is connected by checking if the Steelseries is an eligible input/output selection
  3. If it is eligible, and it’s not selected, select it for both input and output.
  4. If it is eligible and it IS selected, unselect it for both input and output (back to internal speaker and microphones)
  5. If it isn’t eligible (because the receiver isn’t connected) do nothing.

Ideally, I’d love for my Macbook to simply detect if the headset is turned on and if it’s turned on, to select it to be the input and output device. I just can’t think of how I would be able to do that.

I would take a look at this might be close to what you’re looking for

I’ve been wanting auto-detect ability on the arctis7 on macos for a while.
I’ve even asked steelseries support if there was a way to detect that the headset is on or off on macos.
They said an API to detect the headset is not available
I could not find a way to poke at the steelseries engine to get a result either.

But following the link in the reply here, I stumbled upon ‘HeadsetControl’ that actually works on macos!
The source is here:

They key point is that it can detect the headset is ‘on’ by returning a non-zero battery level!

While the headset is connected…

user@macos% headsetcontrol --battery
Found SteelSeries Arctis (7/Pro)!
Battery: 100%
user@macos% echo $?

When the headset is not connected…

user@macos% headsetcontrol --battery
Found SteelSeries Arctis (7/Pro)!
Battery: 0%
user@macos% echo $?

Granted the status code is not an indicator, so you’d have to scan the output.
Also granted there is no actual event to ‘trigger’ the change in audio device either.

But at least this shows that detection is possible.

The key to success may be in inspecting the headsetcontrol code along with the hidapi library it uses battery detection as a building block in whatever scripting language you use (applescript, lua in hammerspoon, etc).