deweller / switchaudio-osx

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

Fix build when run on pre-macOS Monterey #65

Open jwoglom opened 4 months ago

jwoglom commented 4 months ago

When run on macOS versions before Monterey (12.0), the kAudioObjectPropertyElementMain constant does not exist, resulting in a failed build. This is equivalent to the deprecated kAudioObjectPropertyElementMaster constant, which does work. This PR adds a #ifndef to use the old constant pre-Monterey which fixes builds on older macOS versions (e.g. Catalina and Big Sur).