Exemplo n.º 1
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
    }
 public void OnApplicationQuit()
 {
     speechIn.StopListening(); // [mac] do not delete this line
 }
 void OnApplicationQuit()
 {
     speech.StopListening();
 }
 public void OnApplicationQuit()
 {
     _speechOut.Stop();         //Windows: do not remove this line.
     _speechIn.StopListening(); // [macOS] do not delete this line!
 }
Exemplo n.º 5
0
 private void OnApplicationQuit()
 {
     speechOut.Stop();
     speechIn.StopListening();
 }