Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross Browser Speech Recognition

I am currently working on a project in ASP.NET. I need to add voice command which will work on IE/Chrome/Firefox. I have searched a lot, but haven't found any solutions for cross browser.

Is there any JavaScript framework to do it? Can i use Google web speech API as a service?

Any suggestion will be helpful.

like image 630
anan_xon Avatar asked Sep 11 '14 13:09

anan_xon


2 Answers

It can be done as long as the browser supports HTML5's getUserMedia API:

  1. Use HTML5's getUserMedia to capture an audio stream
  2. Save it to .WAV, there are libraries for that
  3. Send the .WAV to the server through AJAX
  4. Feed the .WAV to SpeechRecognitionEngine, through the SetInputToWaveFile method
  5. Get the result and return it in the AJAX call

An example:

http://weblogs.asp.net/ricardoperes/speech-recognition-in-asp-net

like image 176
Ricardo Peres Avatar answered Oct 21 '22 04:10

Ricardo Peres


You can check support for speech recognition in various browsers at Can I Use. At the moment only Chrome supports speech recognition reliably. Others don't, including IE, Firefox and Safari. Firefox is working on the speech recognition support, but it's not there yet.

If your browser supports getUserMedia to record audio you can record the audio and send it to the server for recognition. You can also use javascript-only recognizer Pocketsphinx.js if you want to recognize few simple commands.

On browsers which do not support getUserMedia API you can use Flash object or java applet to capture audio. That's pretty much your only option if you prioritize IE.

like image 40
miller9904 Avatar answered Oct 21 '22 03:10

miller9904