Cordova plugin which will provide a speech recognition service for PhoneGap applications
cordova plugin add https://github.com/manueldeveloper/cordova-plugin-speech-recognizer.git
cordova plugin add com.manueldeveloper.speech-recognizer
You can access to this plugin through navigator.speechrecognizer
and then, you can call to the recognize
method which has the following parameters:
- successCallback: Callback which will be called when the recognition service ends providing the results as JSONArray
- failCallback: Callback which will be called when the recognition service detects a problem with its code error as (String)
- maxResults: Integer with the maximum number of results to provide
- promptMessage: String with a minimum title to show through the user interface
- Android
- iOS (in developing process)
navigator.speechrecognizer.recognize(successCallback, failCallback, 5, "Cordova Speech Recognizer Plugin");
function successCallback(results){
console.log("Results: " + results);
}
function failCallback(error){
console.log("Error: " + error);
}