Quantcast
Channel: naudio Work Item Rss Feed
Viewing all articles
Browse latest Browse all 738

Created Unassigned: COM Exception & UnRegisterEventClient [16499]

$
0
0
I'm receiving a COM error after my app exits if I call UnRegisterEventClient.

Here is a code snippet:
private Dictionary<uint, SessionsEventCallbacks.NAudioEventCallbacks> _sessionNotifications = new Dictionary<uint, SessionsEvents.NAudioEventCallbacks>();
// NAudioEventCallbacks inherits from IAudioSessionEventsHandler
...
private void OnSessionCreated(object sender, IAudioSessionControl newSession)
{
AudioSessionControl audioSession = new AudioSessionControl(newSession);
SessionsEvents.NAudioEventCallbacks notifications = new SessionsEventCallbacks.NAudioEventCallbacks();
notifications.contentCat = 0;
notifications.programType = 0;
notifications.processId = (int)audioSession.GetProcessID;
notifications.processName = Process.GetProcessById((int)audioSession.GetProcessID).ProcessName;
notifications.domain = string.Empty;
notifications.youtubeCategory = string.Empty;
notifications.audioSession = audioSession;
notifications.SessionEndedCallback = AudioStopped;

_sessionNotifications.Add((uint)notifications.processId, notifications);
audioSession.RegisterEventClient(notifications);
}

I call UnRegisterEventClient from AudioStopped.

Any help would be greatly appreciated!

Thanks,
Randall Deetz

Viewing all articles
Browse latest Browse all 738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>