Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get automatically notified on audio device connection/disconnection?

Is it possible to get automatically notified whenever the user connects or disconnects an audio device?

like image 510
user1580348 Avatar asked Oct 20 '25 03:10

user1580348


1 Answers

In Vista+ you can use Core Audio IMMNotificationClient interface to be notified.

The IMMNotificationClient interface provides notifications when an audio endpoint device is added or removed, when the state or properties of an endpoint device change, or when there is a change in the default role assigned to an endpoint device.

Handling WM_DEVICECHANGE and/or polling is the solution in odler OS versions.

like image 159
Roman R. Avatar answered Oct 22 '25 23:10

Roman R.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!