Exemplo n.º 1
0
    public void StartListening()
    {
        bool isSupported = speechPlugin.CheckSpeechRecognizerSupport();

        if (isSupported)
        {
            //number of possible results
            //Note: sometimes even you put 5 numberOfResults, there's a chance that it will be only 3 or 2
            //it is not constant.

            // unmute beep
            utilsPlugin.UnMuteBeep();

            // enable offline
            //speechPlugin.EnableOffline(true);

            // enable partial Results
            speechPlugin.EnablePartialResult(true);

            int numberOfResults = 5;
            speechPlugin.StartListening(numberOfResults);

            //by activating this, the Speech Recognizer will start and you can start Speaking or saying something
            //speech listener will stop automatically especially when you stop speaking or when you are speaking
            //for a long time
        }
        else
        {
            Debug.Log(TAG + "Speech Recognizer not supported by this Android device ");
        }
    }
Exemplo n.º 2
0
    private void StartListening()
    {
        Debug.Log(TAG + " StartListening...  ");
        bool isSupported = speechPlugin.CheckSpeechRecognizerSupport();

        if (isSupported)
        {
            utilsPlugin.UnMuteBeep();

            // enable offline
            // speechPlugin.EnableOffline(true);

            int numberOfResults = 3;
            speechPlugin.StartListening(numberOfResults);
        }
        else
        {
            utilsPlugin.ShowToastMessage(TAG + "Speech Recognizer not supported by this Android device ");
        }
    }