This is in continuation of this question: Getting individual windows application current volume output level as visualized in audio Mixer
How to register an EventHandler which gets called whenever the current output volume of an application (such as windows media player) changes? In other words, how to register an EventHandler which gets called whenever GetPeakValue of an AudioSessionControl changes?
For my application I want it such that whenever the PeakValue of Windows Media Player changes, a function should get called, instead of me continuously polling for the current PeakValue to identify if there is a change or not.
I am using CSCore.CoreAudioAPI to get the current audio value of any application. I tried using AudioSessionEvents (and its event handlers like SimpleVolumeChanged, ChannelVolumeChanged) in CSCore, however I did not find any way to pass an AudioSessionControl object to attached the handlers with.