Love it! I like games with unconventional input systems! As a native English speaker, I still had some trouble getting it to recognize âtealâ
Also, sometimes it detects âMagenta.â instead of âMagentaâ and doesnât match to a color. Maybe strip out punctuation when you do the comparison?
Thank you for the feedback! Strip function added.
RED and TEAL are the most difficult colors at the moment
By the way, it is possible to change the language from en-US to en-UK - somewhere around the line 246 at https://playground.babylonjs.com/#11BXS0#70
recognition.lang = 'en-US';
change to recognition.lang = 'en-UK';
Let me know if it will help you with the British teal color
Worked on Edge. Failed on Firefox. This was in the Firefox console:
Babylon.js viewer (v4.2.0) babylon.viewer.js:3852:111462
JQMIGRATE: Migrate is installed, version 3.3.2 jquery-migrate.min.js:2:709
Uncaught ReferenceError: webkitSpeechRecognition is not defined
babylonpressCMB_WRAP_1119 https://babylonpress.org/3d-blog/3d-demo/color-speech-recognition-game/:284
<anonymous> https://babylonpress.org/3d-blog/3d-demo/color-speech-recognition-game/:869
color-speech-recognition-game:284:25
The resource at âhttps://mc.yandex.ru/metrika/tag.jsâ was blocked because content blocking is enabled.
color-speech-recognition-game
Uncaught TypeError: engine is null
babylonpressCMB_WRAP_1119 https://babylonpress.org/3d-blog/3d-demo/color-speech-recognition-game/:280
color-speech-recognition-game:280:13
Perhaps, you might trap one of these, and call alert('Speech recognition not supported by this browser);`
Do not know what yandex is. Thinking it is a search engine.
Sorry, I should have actually studied the error on firefox. As soon as I saw webkit, I knew what the problem was. Much like other things earlier, Firefox implements it the correct way, it is the others which use webkit for pre-standard stuff.
You probably want to get an initial reference like:
let speechRecogition = SpeechRecognition | webkitSpeechRecognition;
What has happened before is eventually chrome drops the webkit.
This line is there (line 12) var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition
Actually the recognition code in Playground is taken from MDN example. Still it doesnât work in FF
Looks like it has to be enabled to work in some cases. If you type about:config in the address bar, search for speech, and double click media.webspeech.recognition.enable, then itâs working for me in FF on my MacBook, for example. It looks like theyâve dropped the prefixes too.
Edit, actually it only seems to work for me if I change both media.webspeech.recognition.enable AND media.webspeech.recognition.force_enable to trueâŚ
With media.webspeech.recognition parameter enabled FF loaded the page for me too.
Still didnât get any success with recognition - FF doesnât understand me, in contrast with Chrome and Edge.
I just tried something by loading the recognition âgameâ in the browser of an Oculus Quest 2. It errors. , I got no alert, but did double check the console using Chrome remote debugging found webkitSpeechRecognition is not defined
That is really is unfortunate, because you could make editable text fields with a label and a button next to it with a microphone icon on it. Click / touch the button, say something, then the field gets filled with what you said. No keyboard required.
Web searching said something about chrome://flags, but it was in the context of VR and rift (kind of old). Once on the flags page of the device, speech in the search field got no hits.
This really should something which is core for a XR device-based browser. @RaananW , you donât have any insight, do you? Calling you out specifically, since I could see you thinking that this thread was not in your âdomainâ.