!7 sclass HearMyselfTest > DynTextArea { JComponent visualize() { ret withCenteredButtons(super.visualize(), "Do the test", rThread doIt); } void doIt { print("Requiring the cat"); O katze = dm_requireModule("#1016461/Katze"); print("cat=" + katze); print("Requiring voice output"); O voiceOutput = dm_requireModule("#1016614/VoiceOutput"); print("Starting to listen"); call(katze, 'startListening); print("Waiting for recognizer..."); if (!chromeSpeech_hasRecognizer()) { do { sleepSeconds(1); } while (!chromeSpeech_hasRecognizer()); } sleepSeconds(2); // give time to start S text = "I like you"; double seconds = 10; long logLength = fileSize(speechRecognitionLog()); print("Saying & listening for " + seconds + " seconds: " + text); call(voiceOutput, 'say, text); long timeout = sysTime()+toMS(seconds); new Var vLine; ManualTailFile tail = new(speechRecognitionLog(), vfAppendToLineBuffer(unquotingLineBuffer(vfSetVar(vLine)))); while (sysTime() < timeout && !vLine.has()) { tail.check(); sleep(100); } print("Stop listening."); call(katze, 'stopListening); print("Got line: " + vLine!); if (match(text, vLine!)) print("Yes, I can hear me!!"); else if (nempty(vLine)) print("I said: " + quote(text) + ", but I heard: " + quote(vLine!)); else print("I said: " + quote(text) + ", but I heard nothing."); } }