ToddN
ToddN

Reputation: 2961

Control web forms with speech via PHP, HTML5, jQuery?

I am interested in knowing of a way to control web pages (preferably in Chrome Browser) by utilizing speech recognition by means of HTML5, PHP and/or javascript jQuery.

I am aware of HTML5 speech command <input type="text" x-webkit-speech /> but say for instance if you had multiple inputs and you said the word "next" I would want it to focus on the next input. Or say one said the word "submit" it would submit an input, get the drift?

It's probably Custom Speech codes but can't find any info on it, any ideas?

Upvotes: 4

Views: 1983

Answers (1)

net.uk.sweet
net.uk.sweet

Reputation: 12431

If you're happy only to support Chrome at this stage you should be able to do this by checking the value of a webkit speech-enabled input on receipt of the webkitspeechchange event. See fiddle here (hattip to iRomin).

The obvious and quite major catch is that you need a webkit speech-enabled input field on your page and the user must click the microphone icon to start the recording. The W3 specification mentions a startSpeechInput method but that doesn't appear to have been implemented in my version of Chrome (18).

If that's too much of a limitation and you can't wait until Chrome implements the startSpeechInput method, and / or you need to support other browsers, you could have a look at the open source speech API which uses Flash to access the microphone and provides a JavaScript API for the client. From the documentation it looks like it offers a variety of options for the server-side including a hosted service. There are also various demos which should give you an idea of whether or not it's up to the job.

Upvotes: 2

Related Questions