public void CanRegisterSessionNotification() { using (var sessionManager = GetDefaultAudioSessionManager2(DataFlow.Render)) { AudioSessionNotification notification = new AudioSessionNotification(); sessionManager.RegisterSessionNotification(notification); sessionManager.UnregisterSessionNotification(notification); } }
void InitializeAudioSessions() { if (_audioDataFlow == AudioDataFlow.eCapture) { return; } //Get Session manager var result = _audioDevice.Activate(typeof(IAudioSessionManager2).GUID, ClsCtx.ALL, IntPtr.Zero, out object obj); _audioSessionManager2 = (IAudioSessionManager2)obj; //Register event for get session creation sessionNotify = new AudioSessionNotification(); _audioSessionManager2.RegisterSessionNotification(sessionNotify); InitializeAudioSessionDict(); }