Skip to content

[Question] Handling device disconnects #1012

Description

@JamesMoreau

So I have a music player application and I would like for the user to be able to select the audio output device.

The user could switch devices or unplug it in the middle of a track. So, I need to be able to rebuild the stream at any point.

However, I noticed, at least on macOS, that upon disconnecting a device (in this case my headphones), the audio gets automatically rerouted to another device all on its own. This is nice but now I no longer know what the current device actually is. Which means that my application state, which display the current device, is now out of sync.

Is there a way to turn off this feature, or is it something the OS does? Otherwise, is it possible to listen for a particular stream event? Or maybe just even be able to query the current output device given a particular stream?

Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions