I am working with the HTML 5 text input API, and I want the server to know what responses it can expect to receive from speech input. Is there a way to set a list of possible inputs?
In Google Chrome, you still can’t use grammars, in general they decided to use only free-form recognition. Relevant Question: Grammar in the Google Speech API .
Grammars are supported in the Firefox Web Speech API , but this feature is experimental.
If your browser supports HTML5 audio, you can try to recognize words from your grammar using the Pocketsphinx.js library, it provides javascript which should be very good for grammars.
I assume that you are talking about the Speech Input API Specification as defined by the W3C. According to this specification, grammars are supported, which are the method used by speech recognition systems to limit possible inputs. See the section titled “Speech Recognition Grammar”. The problem will be how well it is supported in the particular browser that is being used, which is the case for a specific HTML 5 function, since it is not yet a ready-made standard. Chrome seems to be the most modern with the standard. Check out this blog post from the Chrome team about implementing a speech input API.