I'm looking for a way of selecting an entry from a dropdown list in a webpage using speech recognition.
My initial thoughts are to use Google's x-webkit-speech in an input type="text"
element. And then when the onwebkitspeechchange
event is fired, calculate the Levenshtein distance for each dropdown entry - then select the minimum.
One detail is I'd prefer to have the textbox hidden so it appears you are selecting the microphone for the select element. (Haven't tried this yet but am assuming it could be done...)
A couple of downsides to this are the Levenshtein distance may not always be an accurate way of selecting and it would only work in Google Chrome for the foreseeable future.
Could anyone come up with any alternative suggestions or flesh out any of the detail?
Use grammars to restrict user speech input to what is in the dropdown list and then match the resulting token in the grammar to the list of items in your dropdown to determine the selected item. If the dropdown list is static you can have a static grammar file. If this list is dynamic use an approach as is defined in this answer.