Esempio n. 1
0
        public void RequestDictation(IDictationListener listener)
        {
            ClearListener();

            ActiveListener = listener;
            DictationRecognizer.DictationHypothesis += ActiveListener.OnDictationHypothesis;
            DictationRecognizer.DictationResult     += ActiveListener.OnDictationResult;
            DictationRecognizer.DictationComplete   += ActiveListener.OnDictationComplete;
            DictationRecognizer.DictationError      += ActiveListener.OnDictationError;

            StartDictation();
        }
Esempio n. 2
0
        private void ClearListener()
        {
            if (ActiveListener == null)
            {
                return;
            }

            DictationRecognizer.DictationHypothesis -= ActiveListener.OnDictationHypothesis;
            DictationRecognizer.DictationResult     -= ActiveListener.OnDictationResult;
            DictationRecognizer.DictationComplete   -= ActiveListener.OnDictationComplete;
            DictationRecognizer.DictationError      -= ActiveListener.OnDictationError;

            ActiveListener = null;
        }