Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use x-webkit-speech with a textarea

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>
like image 654
Lloyd Avatar asked May 11 '11 18:05

Lloyd


People also ask

What is X Webkit speech?

x-webkit-speech: Add Mic Speech Input Icon in a Text Input Box.

How do you do voice input in HTML?

You can also start speech input by focussing the element and pressing Ctrl + Shift + . on Windows, or Command + Shift + .


2 Answers

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.

like image 167
Rich Bradshaw Avatar answered Oct 04 '22 00:10

Rich Bradshaw


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/

like image 41
Theo Avatar answered Oct 03 '22 22:10

Theo