예제 #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.

            // enable beep
            speechPlugin.EnableBeep(true);

            // 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 ");
        }
    }
예제 #2
0
    public void StartListeningWithExtraLanguage()
    {
        bool isSupported = speechPlugin.CheckSpeechRecognizerSupport();

        if (isSupported)
        {
            // disable beep
            speechPlugin.EnableBeep(false);

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

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

            int numberOfResults = 5;
            speechPlugin.StartListeningWithHackExtraLanguage(numberOfResults, currentExtraLocale.GetDescription());
        }
        else
        {
            Debug.Log("Speech Recognizer not supported by this Android device ");
        }
    }