Using input tag 'speech' through javascript

Doing this in chrome:

<input id='speech-this' type='text' speech /> 

Creates an input tag with a small microphone. Tapping the microphone allows you to recognize voices, such as searching for Android phones.

My question is: is it possible to do this without the <input> field? I mean, the ideal would be a javascript object that would do something like:

 var what_i_said = chrome.Speech.listen(); 

Or something like that.

Thanks!

+4
source share
2 answers

Opera supports http://www.w3.org/TR/xhtml+voice/ (see http://dev.opera.com/articles/voice/ ).

You can see the WAMI toolkit. The WAMI tool is an interesting project from MIT - http://wami.csail.mit.edu/ . In their own words, "WAMI: Web-accessible multimodal applications. WAMI is an easy way to add speech recognition capabilities to any web page." WAMI provides you with a java applet that can run on your web page to perform audio capture for speech recognition.

+1
source

There is actually a way to do this using JavaScript and do it using the Web Speech API. This allows you to quickly perform speech recognition as well as speech synthesis.

The simplest example of speech synthesis:

 var utterance = new SpeechSynthesisUtterance('Hello World'); window.speechSynthesis.speak(utterance); 

The simplest example of voice recognition:

 var recognition = new webkitSpeechRecognition(); recognition.onresult = function(event) { console.log(event); } recognition.start(); 
0
source

All Articles