Is it possible to programmatically trigger voice dictation on a text input form field in iOS mobile Safari using JavaScript?

StackOverflow https://stackoverflow.com/questions/23153206

Pregunta

I need for the voice input functionality on the iOS keyboard to trigger programmatically via JavaScript by clicking on a microphone icon. Not just by detecting the "paste" event: I mean prompting the user for voice dictation.

I know that iOS sports VoiceOver at the OS level, but other than a few accessibility attributes, I am unable to find any references how to manipulate voice input on an HTML text field.

I have seen demos of the WebKit Speech API such as this, but none of them are honored in iOS mobile Safari. Nor does adding the now deprecated -x-webkit-speech attribute to my text input fields. I have also seen people suggest wrapping web apps using PhoneGap, which doesn't actually solve the problem.

I have searched exhaustively and even Stack Overflow's automatic scrubbing for my answer didn't help.

Any wisdom on how one might go about doing this or if it's even possible? Thanks in advance!

¿Fue útil?

Solución

You are asking about speech recognition, right? That's not supported by safari yet, maybe iOS 8 brings it.

Wrapping the web app using Phonegap might be a solution if you use one of the speech recognition plugins available, but your user will need to use the app instead the regular browser.

As you talk about Voice Over, thats for Text To Speech, not Speech recognition, Text To Speech is possible with iOS 7, take a look to this article http://www.sitepoint.com/talking-web-pages-and-the-speech-synthesis-api/ and this live demo http://aurelio.audero.it/demo/speech-synthesis-api-demo.html

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top