Is there any notification when headphones are unplugged?


#1

I want to handle a scenario in my application when headphones are unplugged from the system. Whenever headphone is removed, JUCE gets notification in deviceListenerProc of CoreAudioInternal, however it is not handled in kAudioDevicePropertyDataSource case.
Is there any other way of handling this notification?

OS: Mac OS 10.13.2
JUCE Version: 5.2.0


#2

I think kAudioDevicePropertyDataSource is the only way to get that information, but I also suspect it will give you notifications about a whole host of other things like changes to aggregate audio devices as well as headphones.


#3

What about on windows? Is there something equivalent or similar to kAudioDevicePropertyDataSource ?