예제 #1
0
        private void UnregisterNotifications()
        {
            if (_audioSessionNotification == null)
            {
                return;
            }

            Marshal.ThrowExceptionForHR(_audioSessionManager2.UnregisterSessionNotification(_audioSessionNotification));
            _audioSessionNotification = null;
        }
예제 #2
0
        private void UnregisterNotifications()
        {
            sessions = null;

            if (audioSessionNotification != null && audioSessionInterface2 != null)
            {
                Marshal.ThrowExceptionForHR(
                    audioSessionInterface2.UnregisterSessionNotification(audioSessionNotification));
                audioSessionNotification = null;
            }
        }
        private void UnregisterNotifications()
        {
            if (_Sessions != null)
            {
                _Sessions = null;
            }

            if (_AudioSessionNotification != null)
            {
                Marshal.ThrowExceptionForHR(_AudioSessionManager2.UnregisterSessionNotification(_AudioSessionNotification));
            }
        }
        public override void UninitializeAudio()
        {
            if (null != _audioSessionEventDict)
            {
                foreach (var ctl in _audioSessionEventDict)
                {
                    ctl.Value.AudioSessionEventClass.UnRegisterSessionVolumeCallBack(OnSessionChangeCallBack);
                    ctl.Value.AudioSessionEventClass.UnRegisterSessionStateCallBack(OnSessionStateChange);
                    ctl.Key.UnregisterAudioSessionNotification(ctl.Value.AudioSessionEventClass);
                    Marshal.ReleaseComObject(ctl.Key);
                }
            }

            if (null != _audioSessionManager2)
            {
                _audioSessionManager2.UnregisterSessionNotification(sessionNotify);
                Marshal.ReleaseComObject(_audioSessionManager2);
            }
            base.UninitializeAudio();
        }