deweller / switchaudio-osx

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

Cannot switch audio device by "uid", the '-u' argument; 'Could not find an audio device with UID' error #53

Closed mayhemer closed 1 year ago

mayhemer commented 1 year ago

AudioObjectGetPropertyData uses CFStringRef instead of raw char buffer. This patch fixes it. I would also add some error checking to the code, but I wanted to keep the changes minimal.

mayhemer commented 1 year ago

This was discovered and tested only on macOS 13.3.1 (22E261). I don't have any other system versions to test on. And documentation for this CoreAudio function is pretty vague...

deweller commented 1 year ago

Thanks!