On a 600x600 pixel canvas draw an arc (circle) in the very center of the canvas with a radius of 25 and the fillStyle of black. When the user enters in a diameter value adjust that for the radius value used in the program.
Offer the users:Have a button with that with the value of "Speak". When the user clicks on that button the value changes to "Stop"
Have your program respond to the following words or phrases:
Have on the screen instructions that list the following, but write so it looks like instructions for a user:
Use variables to hold the color and size values, so you can set them separately from the drawing function.
If they ask for an invalid color, JavaScript ends up not changing the color and uses the previous fillStyle. You can always set the fillStyle first to "Black" and then set it to the value that the user speaks. This way if they speak an invalid color, the circle still appears in Black.
When the user presses the Speak button, have the program listen and stop when the user stops speaking (which is automatic) or if they press "Stop".
https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/onresult
Set continuous to be false, but start the recognition again, if you want to keep listening for more commands. Otherwise try the continuous feature, but I found it easier to start the recognition after it stopped.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here