0

I need to integrate an Voice recognizing API in my PHP Project which is currently hosted in an Linux Server.

Following are few of the API's i have gone through but dint help the course:

  1. SpeechAPI
  2. iSpeech
  3. cmu sphinx

CMU Sphinx is a great open source tool but is been built in the Java Programming language , i have also read Connecting to CMU Sphinx using PHP

But Dint't found the exact solution to it.

Requirement

The feature that i looking to built is something like the user would visit to a certain page in the website and would speak the name of the link to which he wants to navigate to through his micro - phone and the user would be navigated to the requested page. Eg: If he says Home so the site would redirect him to the home page.

Platform : PHP , Laravel , Linux

Thanks for your valuable help :).

Community
  • 1
  • 1
laracaster
  • 31
  • 3
  • 11
  • i have looked into that thread as well , but that din't help. – laracaster Apr 14 '15 at 06:40
  • Something like this ought to be done on the client somehow, perhaps as a browser feature/plugin/extension. I am sure it could be done on the server, but the time from the commands are spoken till something happens will most likely be prohibitive (i.e. it would not be a good experience). Searching the internet for "browser speech recognition" gives some interesting results. – Sverri M. Olsen Apr 14 '15 at 07:08
  • @SverriM.Olsen is there a way you know that voice recognition would be ran @ server side? , i have successfully deployed the CMU Sphinx in the windows desktop , its an Speech Recognition software written in java , currently it just give the output in the console when we run it , i want to upload in the linux server as a web app , how can i do that ? please help , FYI: i have not worked in java app before. – laracaster Apr 15 '15 at 07:51

1 Answers1

0

If the requirement is to have the user speak and navigate your site, you really don't need to implement the speech recognition on the server side. You can use a number of JS libraries or even Google Chrome's voice recognition API.

http://shapeshed.com/html5-speech-recognition-api/

An example piece of code that would navigate you around a website in chrome would look similar to this below:

var recognition = new webkitSpeechRecognition();
recognition.onresult = function(event) { 
    location.pathname = event.results[0][0].transcript;
}
recognition.start()

Try pasting this into your developer tool's console to test it out or play with it here on this js fiddle i created for you. https://jsfiddle.net/hdcxxkec/

EDIT:

Here is a cross browser js library http://syl22-00.github.io/pocketsphinx.js/ The demo uses small grammar files, you probably would want to have a Navigation grammar file.

JediMind
  • 121
  • 1
  • 3
  • Don't forget to hit the "Allow" button when Google Chrome prompts you for permission to use your microphone. – JediMind Apr 14 '15 at 07:10
  • jediMind thanks for this , but i believe that it would only work in Chrome Browser Only , need to make it work for all the browsers. – laracaster Apr 14 '15 at 07:16
  • I've updated the answer with a link to a cross browser library. Hope you find the answer you're looking for. – JediMind Apr 14 '15 at 07:30
  • This is a great solution but again it doen't work in the IE and the Safari browser's.. :( – laracaster Apr 15 '15 at 07:53