Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coreaudio module not detecting changes of the default audio device. #249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alex-the-man
Copy link

No description provided.

src/coreaudio.c Outdated
@@ -139,12 +139,15 @@ static void destroy_ca(struct SoundIoPrivate *si) {
struct SoundIoCoreAudio *sica = &si->backend_data.coreaudio;

AudioObjectPropertyAddress prop_address = {
kAudioHardwarePropertyDevices,
kAudioHardwarePropertyDefaultOutputDevice,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't replace kAudioHardwarePropertyDevices, because that will stop us from rescanning if an audio device is added which does not change the default input or output device.

Just adding listeners for kAudioHardwarePropertyDefaultOutputDevice and kAudioHardwarePropertyDefaultInputDevice should work, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Changed my PR.

@alex-the-man alex-the-man force-pushed the fix-core-audio-default-device-change branch from b4a09e8 to f3bb0d0 Compare December 28, 2020 02:08
Copy link
Contributor

@cgutman cgutman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested working on macOS Big Sur 11.1 by switching between Bluetooth, AirPlay, and Internal Speakers in System Preferences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants