cordova-plugin-speechrecognition
Advanced tools
Comparing version
{ | ||
"name": "cordova-plugin-speechrecognition", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Cordova Plugin for Speech Recognition", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -35,8 +35,16 @@ # cordova-plugin-speechrecognition | ||
```js | ||
let options = { | ||
String language, | ||
Number matches, | ||
String prompt, // Android only | ||
Boolean showPopup, // Android only | ||
Boolean showPartial // iOS only | ||
} | ||
window.plugins.speechRecognition.startListening( | ||
Function successCallback, Function errorCallback, | ||
String language, Number matches, String prompt, Boolean showPartial) | ||
Function successCallback, Function errorCallback, Object options) | ||
``` | ||
This method has 4 optional parameters: | ||
This method has an options parameter with the following optional values: | ||
@@ -46,2 +54,3 @@ - `language` {String} used language for recognition (default `"en-US"`) | ||
- `prompt` {String} displayed prompt of listener popup window (default `""`, Android only) | ||
- `showPopup` {Boolean} display listener popup window with prompt (default `true`, Android only) | ||
- `showPartial` {Boolean} Allow partial results to be returned (default `false`, iOS only) | ||
@@ -120,3 +129,3 @@ | ||
This method requests access permission to system resources it was not granted before. | ||
This method requests access permission to system resources if it was not granted before. | ||
@@ -123,0 +132,0 @@ |
@@ -5,4 +5,5 @@ module.exports = { | ||
}, | ||
startListening: function(successCallback, errorCallback, language, matches, prompt, showPartial) { | ||
cordova.exec(successCallback, errorCallback, 'SpeechRecognition', 'startListening', [language, matches, prompt, showPartial]); | ||
startListening: function(successCallback, errorCallback, options) { | ||
options = options || {}; | ||
cordova.exec(successCallback, errorCallback, 'SpeechRecognition', 'startListening', [ options.language, options.matches, options.prompt, options.showPartial, options.showPopup ]); | ||
}, | ||
@@ -9,0 +10,0 @@ stopListening: function(successCallback, errorCallback) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35949
14.87%12
9.09%346
53.78%180
5.26%