Voice command recognition using Levenshtein distance and Web Speech API

Voice command recognition using Levenshtein distance and Web Speech API

One of very interesting and potentially quite useful HTML5 APIs is the Web Speech API. At the moment there are some disagreements regarding actual implementation and only Google Chrome supports it in full, but we have decided to do go ahead and build a small test app anyway. You can find the source at:

 https://github.com/SupplyFrame/rvc

Open the demo page at http://supplyframe.github.io/rvc/ allow microphone usage and start speaking. Commands are basic: up, down, left, right. Hopefully, you should get the ball to move :)

However, the speech recognition doesn't have that much of an accuracy. In order to address that - we compare the recognized text with each of available commands using Levenshtein distance. By doing this and increasing distance threshold, we're able to significantly increase the command recognition accuracy. Try moving the slider in order to change the threshold on the demo page and see what happens. Have fun !

For additional reference on Web Speech API, check out:

https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html

http://updates.html5rocks.com/2013/01/Voice-Driven-Web-Apps-Introduction-to-the-Web-Speech-API

  1. is there a faster alternative to Levenshtein's distance?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>