Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Commit

Permalink
Adding Chrome support for color changer
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdavidmills committed Nov 26, 2015
1 parent 1036f84 commit 79a5079
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion speech-color-changer/script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition
var SpeechGrammarList = SpeechGrammarList || webkitSpeechGrammarList
var SpeechRecognitionEvent = SpeechRecognitionEvent || webkitSpeechRecognitionEvent

var grammar = '#JSGF V1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;'
var recognition = new SpeechRecognition();
var speechRecognitionList = new SpeechGrammarList();
Expand All @@ -11,7 +15,7 @@ recognition.maxAlternatives = 1;
var diagnostic = document.querySelector('.output');
var bg = document.querySelector('html');

document.body.ontouchend = function() {
document.body.onclick = function() {
recognition.start();
console.log('Ready to receive a color command.');
}
Expand Down

0 comments on commit 79a5079

Please sign in to comment.