I have a field in my webapp where users are entering a large amount of text. I would like to implement the x-webkit-speech element. it works in all the
<input>
boxes, but I cannot get it to render in the
<textarea name="uxMyInput" rows="30" cols="20" id="uxMyInput" onblur="convert();" style="width:100%;" x-webkit-speech=""></textarea>
x-webkit-speech: Add Mic Speech Input Icon in a Text Input Box.
You can also start speech input by focussing the element and pressing Ctrl + Shift + . on Windows, or Command + Shift + .
Currently it only works on inputs. I assume that support for longer text entry will come eventually, but as users might expect to record much longer entries I suspect they were worried the accuracy and time for processing would be affected.
The answer is fairly straightforward: add a text input box above your text area and then use the onwebkitspeechchange attribute to cause the newly recognized text to be copied from the input box to the text area.
I have posted a code sample on jsfiddle:
http://jsfiddle.net/theo/GZ5mL/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With