Esempio n. 1
0
        void Start()
        {
            upperHandle = GetComponent <UpperHandle>();
            lowerHandle = GetComponent <LowerHandle>();
            lineDraw    = GameObject.Find("Panto").GetComponent <LineDraw>();
            Debug.Log("Before Introduction");
            speechIn.StartListening(keywords.Keys.ToArray());


            level1 = GameObject.Find("Level1");
            level1.SetActive(false);

            level2 = GameObject.Find("Level2");
            level2.SetActive(false);

            level4 = GameObject.Find("Level4");
            level4.SetActive(false);

            RegisterColliders();
            if (levelMode)
            {
                Debug.Log(levelMode);
                Levels();
            }
            else
            {
                lineDraw.canDraw = true;
            }
        }
Esempio n. 2
0
    private async void Dialog()
    {
        speechIn.StartListening(); //startup native speech
        await Task.Delay(1000);

        await speechOut.Speak("Welcome to the DualPanto Corona Diagnosis App");

        await speechOut.Speak("Time to greet me");

        //Debug.Log("Hello!"); // system says hello
        await speechIn.Listen(new string[] { "hello", "hi", "hey" }); //wait for greet

        //await Task.Delay(2000); // wait 2s
        await speechOut.Speak("How are you?!");

        string health = await speechIn.Listen(new string[] { "I'm fine", "so-so", "I'm sick" }); //wait for response

        switch (health)
        { // switch response
        case "I'm fine":
            Debug.Log("super!");
            break;

        default:
            Debug.Log("alright, take care.");
            await speechOut.Speak("crazylaugh");

            await speechOut.Speak("you really thought I would diagnose you?!");

            break;
        }
        speechIn.StopListening(); //terminates voice recognition
    }
 void Update()
 {
     if (Input.GetKeyDown("space"))
     {
         speechIn.PauseListening(); //pause listening ([mac] clears all commands)
     }
     if (Input.GetKeyDown("return"))
     {
         speechIn.StartListening(commands); //you can update commands
     }
 }
    void Start()
    {
        // looks in the (current) gameObject for component of type Rigidbody
        // gameObject.GetComponent<Rigidbody>() would work as well
        playerRb     = GetComponent <Rigidbody>();
        soundEffects = GetComponent <PlayerSoundEffect>();
        //activatePlayer();

        speech = new SpeechIn(onSpeechRecognized);
        speech.StartListening(new string[] { "help", "resume" });
    }
 void Start()
 {
     Debug.Log("Hit spacebar to pause, hit return to change commands");
     speechIn = new SpeechIn(onRecognized, commands);
     speechIn.StartListening(new string[] { "hungry" }); // you can override here
 }