Open hao-lh opened 1 year ago
Looking at the apple docs that symbol was added in MacOS 12 (Monterey). Which is 3 versions newer than Mojave (10.14). So I suspect the quick answer is that switch audio-osx doesn't support your version of os x.
It might be possible to add backwards compatibility using older apis, but I think you are better off upgrading to a newer version of os x. (if your hardware is too old, take a look at oclp
But the readme suggests it should work on 10.7 and newer.
Hmm, maybe the readme is out of date? It looks like kAudioObjectPropertyElementMain symbol was added in 1.2.0. Can you build v 1.1.0?
Given that new symbols only found in macOS 12 Monterey are now being used, it looks like switchaudio-osx
now only runs on macOS 12 Monterey and newer. This can be confirmed by looking at the status on MacPorts:
https://ports.macports.org/port/switchaudio-osx/details/
If this is the case, the readme.md
file on the Github project page should be updated accordingly. Or the source code should be changed to support the 10.7 and later.
@igorbernstein -- I can confirm that v1.1.0 still builds and runs find on Lion Mac OS X 10.7.5 (and presumably on newer macOS releases such as Mojave).
But the versions 1.2.0 to 1.2.2 do not build. But I see a different build error on Lion than that reported for Mojave.
fatal error: 'CoreAudio/AudioHardwareBase.h' file not found
#include <CoreAudio/AudioHardwareBase.h>
^
1 error generated.
Building environment: Xcode: Version 11.3.1 (11C505) macOS Mojave 10.14.6 (18G9323)
Building details:
I see there is a building error occurred from audio_switch.c:718:23: error: use of undeclared identifier 'kAudioObjectPropertyElementMain', could you help take a look? Thanks.