Example #1
0
        protected virtual void Awake()
        {
            luisManager = gameObject.GetComponent <LuisManager>();
            // Query the maximum frequency of the default microphone.
            int minSamplingRate; // Not used.

            Microphone.GetDeviceCaps(deviceName, out minSamplingRate, out samplingRate);

            dictationRecognizer = new DictationRecognizer();
            dictationRecognizer.DictationHypothesis += DictationRecognizer_DictationHypothesis;
            dictationRecognizer.DictationResult     += DictationRecognizer_DictationResult;
            dictationRecognizer.DictationComplete   += DictationRecognizer_DictationComplete;
            dictationRecognizer.DictationError      += DictationRecognizer_DictationError;
        }
        protected virtual void Start()
        {
            // If no LuisManager, try to get one from the same GameObject.
            if (luisManager == null)
            {
                luisManager = GetComponent <LuisManager>();
            }

            // Start listening?
            if (autoStartListening)
            {
                StartListening();
            }
        }
Example #3
0
        protected virtual void Start()
        {
            // If no LuisManager, try to get one from the same GameObject.
            if (luisManager == null)
            {
                luisManager = GetComponent <LuisManager>();
            }

            // Validate components
            if (luisManager == null)
            {
                Debug.LogError($"{nameof(luisManager)} is not set to a valid instance. {nameof(LuisDictationManager)} is disabled.");
                enabled = false;
                return;
            }

            // Start listening?
            if (autoStartListening)
            {
                StartListening();
            }
        }