2

Is there anyway that I could use the default microphone on the android keyboard on mobile devices to do voice recognition on a input field?

For example, when you click a input field that has a

<input type ="tel" value="">

it brings up the android keyboard with only numbers. Is there something similar that would be able to do

<input type="microphone" value =""> 

and it would bring up the android keyboard but with the "speak now" speech recognition. Then once you are done speaking it would fill in the input field with your spoken words.

I have tried to do it with other alternative like flash but it really does not work that well. I also, tried this

<input type="file" accept="audio/*;capture=microphone"></input>  

but that just records your voice does no speech to text translation.

Alex
  • 530
  • 3
  • 12
  • 28
  • see answer here: https://stackoverflow.com/questions/27846392/access-microphone-from-a-browser-javascript – Z80 Apr 30 '20 at 14:18

1 Answers1

3

Chrome supports speech recognition for text input. See http://slides.html5rocks.com/#speech-input and http://www.filosophy.org/2011/03/talking-to-the-web-the-basics-of-html5-speech-input/. These use the following tag for speech recognition:

<input type=”text” speech x-webkit-speech />

However, I don't believe that this is supported by the Android browser.

Most web pages with text inputs automatically display a microphone on the keyboard for speech recognition. If you are using a custom keyboard instead of the stock keyboard, you may not see this.

Of course, you can force the recognizer to be used in a native Java app. I just don't think you can force this in a web page.

enter image description here.

Michael Levy
  • 12,767
  • 15
  • 60
  • 98
  • exactly so is there a way to have the keyboard already set to the the microphone button so when you click the input field it is already up and running waiting for the user to say something. Instead of having to tap the microphone icon. @Michael Levy – Alex Jun 05 '12 at 17:15
  • not to my knowledge. In general, the philosophy on those types of things is leave it to the user to choose an action. I can't think examples where your code can force that type of action. – Michael Levy Jun 05 '12 at 17:18