deweller / switchaudio-osx

Change the audio source for Mac OS X from the command line.
Other
1.16k stars 88 forks source link

UID property is empty #47

Closed Sigafoos closed 1 year ago

Sigafoos commented 1 year ago
{
  "name": "MacBook Pro Microphone",
  "type": "input",
  "id": "82",
  "uid": ""
}
{
  "name": "ZoomAudioDevice",
  "type": "input",
  "id": "49",
  "uid": ""
}
{
  "name": "MacBook Pro Speakers",
  "type": "output",
  "id": "75",
  "uid": ""
}
{
  "name": "ZoomAudioDevice",
  "type": "output",
  "id": "49",
  "uid": ""
}

It would be great to be able to use the UID: I have two external monitors and want to occasionally route audio through one, but their int ids occasionally change. But for some reason those periodically change, so the UID would be preferable.

thewellington commented 1 year ago

Agreed. I could make use of the UUIDs too

deweller commented 1 year ago

Is this a universal problem? Or is it specific to some version of the OS?

I'm OS X 11.7.4 and it still works for me:

SwitchAudioSource -a -f json
{"name": "Notabrick Vibe", "type": "input", "id": "57", "uid": "50-c0-f0-e5-e0-2d:input"}
{"name": "Logitech Wireless Headset", "type": "input", "id": "81", "uid": "AppleUSBAudioEngine:Logitech:Logitech Wireless Headset:88C6263575C8:1"}
{"name": "MacBook Pro Microphone", "type": "input", "id": "52", "uid": "BuiltInMicrophoneDevice"}
{"name": "Acer XFA240", "type": "output", "id": "66", "uid": "04722C06-0000-0000-111B-010380351E78"}
{"name": "Notabrick Vibe", "type": "output", "id": "61", "uid": "50-c0-f0-e5-e0-2d:output"}
{"name": "Logitech Wireless Headset", "type": "output", "id": "84", "uid": "AppleUSBAudioEngine:Logitech:Logitech Wireless Headset:88C6263575C8:2"}
{"name": "MacBook Pro Speakers", "type": "output", "id": "45", "uid": "BuiltInSpeakerDevice"}
Sigafoos commented 1 year ago

I'm on 13.0, and I believe it was an issue when I was on 12.x as well: is it possible that something changed in one of the latest versions?

deweller commented 1 year ago

I've published version 1.2.0. This replaces some of the deprecated system calls. Perhaps this will resolve the issue on the more recent operating systems.

Sigafoos commented 1 year ago

I just upgraded to 1.2.0 via homebrew and still no uids

deweller commented 1 year ago

Got it. I think @tannerellen has a fix for us in #52.

deweller commented 1 year ago

Version 1.2.1 includes #52 and is merged into homebrew