Open nsaxelby opened 3 years ago
Small update, I nulled the _session on my SoundDevice object on the Dispose, and called GC.Collect(). This seemed to limit the number of updates sent at once to 4.
public void Dispose()
{
if(_session != null)
{
_session.UnRegisterEventClient(this);
// I think Dispose calls UnRegisterEventClient anyway.. But belt and braces
_session.Dispose();
_session = null; // null obj
GC.Collect(); // Force GC collection
}
}
Does seem to help a little, max of 4 events raised, even on many re-binds.
Hello, sample code further below.
Expected: When I register a IAudioSessionEventsHandler on an AudioSessionControl, I expect to receive one OnVolumeChanged event when the volume is changed.
Actual: When I start my application, it receives two events per volume adjustment ( no big deal ), but when I unbind that object, and re-bind the AudioSessionControl to a new object, multiple events trigger when the Session volume is adjusted.
You can see in the sample application provided, multiple events are firing after AudioSessionControl is unregistered, and registered to a IAudioSessionEventsHandler object.
Curretly using build : 63c7011a7559cb55719e306dd3ab716b25e26d6a ( current version of Master branch ). Console application using .NET Framework 4.7.2
Steps to reproduce:
Console output example: