The experiment uses webkitSpeechRecognition
to repeatedly listen to voice
commands and execute them. This is nothing new, see below for ready made solutions.
Here I have added feedback, so that the user knows what is happening, and improved responsiveness. Responsiveness may sometimes become an issue when the final recognition result is delivered with a noticeable delay, up to several seconds (this may be due to poor microphone perhaps). The interim results are hovever often good enough so that the last interim result is used if there are no new results within one second.
Open the demo in Chrome, allow microphone access when prompted and say "next page", "down" or "forward" to scroll down and "previous page", "up" or "back" to scroll up.
Actually my code is based on the ideas in these two libraries.
Copyright 2017 Marcin Simonides, licensed under the MIT License