Can be done but to use asterisks as the audio capture and processing engine. See http://www.voip-info.org/wiki/view/Sphinx
Example code below after your server has been configured
function sphinx($filename='', $timeout=3000, $service_port = 1069, $address = '127.0.0.1'){
/* if a recording has not been passed in we create one */
if ($filename=="") {
$filename = "/var/lib/asterisk/sounds/sphinx_".$this->request['agi_uniqueid'];
$extension = "wav";
$this->stream_file('beep', 3000, 5);
$this->record_file($filename, $extension, '0',$timeout);
$filename=$filename.'.'.$extension;
}
/* Create a TCP/IP socket. */
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if ($socket < 0) {
return false;
}
$result = socket_connect($socket, $address, $service_port);
if ($result < 0) {
return false;
}
//open the file and read in data
$handle = fopen($filename, "rb");
$data = fread($handle, filesize($filename));
socket_write($socket, filesize($filename)."\n");
socket_write($socket, $data);
$response = socket_read($socket, 2048);
socket_close($socket);
unlink($filename);
return $response;
}
Another thought after looking at the website is that sphinx 4 allows web service access to the recognition processing daemon ie: run sphinx as a daemon (its java!) then you can do socket opens as above to feed a .wav into it directly basically using a modification of the code above so instead of calling the asterisks server to retrieve then record the audio you would use something else perhaps html5 etc to record the audio.
Another thing to consider is that chrome and html5 has built in speech recognition