예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        speechIn = new SpeechIn(onRecognized);
        speechIn.setMetaCommands(metaCommands);
        speechOut = new SpeechOut();

        GenerateDialog().play(speechIn, speechOut);
    }
예제 #2
0
 void Start()
 {
     speechIn  = new SpeechIn(onRecognized);
     speechOut = new SpeechOut();
     Dialog();
     speechIn.setMetaCommands(new List <string> {
         "repeat", "quit", "options"
     });
 }
 public int currentChunkId = -1; // allow to start at a later block if the apparatus crashes during execution
 // start with chunk -1 (test runs)
 // Use this for initialization
 void Start()
 {
     speech            = new SpeechOut();
     obstacleManager   = GameObject.Find("Manager").GetComponent <StudyObstacleManager>();
     studyUIManager    = GameObject.Find("UI").GetComponent <StudyUIManager>();
     targetAudioSource = GetComponent <AudioSource>();
     Time.timeScale    = 1;
     ReadProtocol();
     studyUIManager.ShowIntroMenu();
 }
    void Awake()
    {
        _speechIn  = new SpeechIn(onRecognized, _commands.Keys.ToArray());
        _speechOut = new SpeechOut();

        if (level < 0 || level >= enemyConfigs.Length)
        {
            Debug.LogWarning($"Level value {level} < 0 or >= enemyConfigs.Length. Resetting to 0");
            level = 0;
        }
    }
예제 #5
0
        // Start is called before the first frame update
        public override async Task StartLevel(LineDraw lineDraw, SpeechIn speechIn, SpeechOut speechOut)
        {
            await speechOut.Speak("Now you have an empty paper, draw your own face. Feel free to use the options command for all tools.");

            lineDraw.canDraw = true;
            await speechOut.Speak("Say yes when you're ready.");

            await WaitFunction(ready);

            lineDraw.canDraw = false;
            speechOut.Speak("Congratulations! You completed your first own drawing!");
        }
    public async void play(SpeechIn speechIn, SpeechOut speechOut, bool silent = false)
    {
        asr = speechIn;
        tts = speechOut;
        if (!silent & sentences != "")
        {
            await tts.Speak(sentences);
        }
        if (soundSource && soundSource.clip)
        {
            await playSound();
        }
        if (action != null)
        {
            await action.Invoke(actionarg);
        }
        string recognized;

        switch (options.Count)
        {
        case 0:     //no options, endNode
            return;

        case 1:                                //single option, listen without return
            DialogOption singleOption = options.ToArray()[0];
            if (singleOption.commands == null) //option has no commands, move on to next node
            {
                singleOption.next.play(asr, tts);
                return;
            }
            recognized = await asr.Listen(singleOption.commands.ToArray());

            if (checkMetaCommands(recognized) == false)
            {
                singleOption.next.play(asr, tts);
            }
            break;

        default:     // various options
            recognized = await asr.Listen(generateCommandArray());

            foreach (DialogOption option in options)
            {
                if (option.commands.Contains(recognized))
                {
                    option.next.play(asr, tts);
                }
            }
            checkMetaCommands(recognized);
            return;
        }
    }
예제 #7
0
        // Start is called before the first frame update
        public override async Task StartLevel(LineDraw lineDraw, SpeechIn speechIn, SpeechOut speechOut)
        {
            await speechOut.Speak("Now you can find your Mouth and the two Eyes in the picture. Draw a nose in the right spot");

            await speechOut.Speak("Use the voice commands Mouth, Eye, 0 and 1 and see whats happening.");

            lineDraw.canDraw = true;
            await speechOut.Speak("Can you find your drawn nose? Say yes when you're ready.");

            await WaitFunction(ready);

            lineDraw.canDraw = false;
            await lineDraw.TraceLine(lineDraw.lines["line" + (lineDraw.lineCount - 1)]);
        }
예제 #8
0
    void Awake()
    {
        // Ensure these are disabled at the start of the game.
        player.SetActive(false);
        enemy.SetActive(false);

        _speechIn  = new SpeechIn(onRecognized, _commands.Keys.ToArray());
        _speechOut = new SpeechOut();

        if (level < 0 || level >= enemyConfigs.Length)
        {
            Debug.LogWarning($"Level value {level} < 0 or >= enemyConfigs.Length. Resetting to 0");
            level = 0;
        }
    }
예제 #9
0
        // Start is called before the first frame update
        public override async Task StartLevel(LineDraw lineDraw, SpeechIn speechIn, SpeechOut speechOut)
        {
            await speechOut.Speak("Here you can find the first half of a face.");

            LineRenderer face = GameObject.Find("Face").GetComponent <LineRenderer>();

            GameObject.Find("Panto").GetComponent <GameManager>().AddVoiceCommand("Face", () =>
            {
                lineDraw.TraceLine(face);
            });
            await speechOut.Speak("Draw the second half.");

            lineDraw.canDraw = true;
            await speechOut.Speak("Say yes when you're ready.");

            await WaitFunction(ready);

            lineDraw.canDraw = false;
            await speechOut.Speak("Congrats you just drew a face!");
        }
예제 #10
0
        // Start is called before the first frame update
        public override async Task StartLevel(LineDraw lineDraw, SpeechIn speechIn, SpeechOut speechOut)
        {
            await speechOut.Speak("Welcome to Panto Drawing");

            await speechOut.Speak("Explore your drawing area. Say yes when you're ready.");

            Debug.Log(drawn);
            await WaitFunction(ready);

            Debug.Log(drawn);
            await speechOut.Speak("Lets make your first drawing.");

            LineRenderer mouth = GameObject.Find("Mouth").GetComponent <LineRenderer>();

            GameObject.Find("Panto").GetComponent <GameManager>().AddVoiceCommand("Mouth", () =>
            {
                lineDraw.TraceLine(mouth);
            });

            await speechOut.Speak("Here you can feel the first half of a mouth.");

            await lineDraw.TraceLine(mouth);

            await speechOut.Speak("Draw the second half. Turn the upper Handle to start drawing.");

            lineDraw.FindStartingPoint(mouth);
            lineDraw.canDraw = true;
            await speechOut.Speak("Say yes when you're ready.");

            Debug.Log(drawn);
            await WaitFunction(ready);

            Debug.Log(drawn);
            lineDraw.canDraw = false;
            LineRenderer secondMouth = lineDraw.lines["line" + (lineDraw.lineCount - 1)];

            lineDraw.CombineLines(mouth, secondMouth, true); //they will be both one line in "Mouth", invert the second line
            await lineDraw.TraceLine(mouth);
        }
예제 #11
0
        // Start is called before the first frame update
        public override async Task StartLevel(LineDraw lineDraw, SpeechIn speechIn, SpeechOut speechOut)
        {
            LineRenderer eye = GameObject.Find("Eye").GetComponent <LineRenderer>();

            GameObject.Find("Panto").GetComponent <GameManager>().AddVoiceCommand("Eye", () =>
            {
                lineDraw.TraceLine(eye);
            });
            lineDraw.TraceLine(eye);
            await speechOut.Speak("Here you can feel a human eye.");

            await speechOut.Speak("Draw the second eye now.");

            lineDraw.canDraw = true;
            await speechOut.Speak("Say circle when you're ready, then yes.");

            await WaitFunction(ready);

            lineDraw.canDraw = false;
            LineRenderer secondEye = lineDraw.lines["line" + (lineDraw.lineCount - 1)];

            await lineDraw.TraceLine(secondEye);
        }
예제 #12
0
 void Start()
 {
     audioSource = GetComponent <AudioSource>();
     speechOut   = new SpeechOut();
     InitSpeech();
 }
예제 #13
0
 // Start is called before the first frame update
 public override async Task StartLevel(LineDraw lineDraw, SpeechIn speechIn, SpeechOut speechOut)
 {
     await speechOut.Speak("Turn the upper handle to start drawing, use the options command for all available functions. After drawing a line you can find it too.");
 }
예제 #14
0
 void Start()
 {
     speechIn  = new SpeechIn(onRecognized);
     speechOut = new SpeechOut();
     Dialog(); //Separately run asynchronous Dialog system.
 }
예제 #15
0
 public abstract Task StartLevel(LineDraw lineDraw, SpeechIn speechIn, SpeechOut speechOut);
예제 #16
0
 void Start()
 {
     speechOut = new SpeechOut();
     Dialog();
 }
예제 #17
0
        //public FirstLevel firstLevel; um die level ggf auszulagern in ein eigenes Skript aber das mag grad nciht

        void Awake()
        {
            speechIn  = new SpeechIn(onRecognized, keywords.Keys.ToArray());
            speechOut = new SpeechOut();
        }