cordova-plugin-speechrecognition
Advanced tools
Comparing version
# Changelog | ||
## v1.1.2 | ||
- iOS: `startListening` do not run in background | ||
- iOS: `startListening` check existing process | ||
## v1.1.1 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "cordova-plugin-speechrecognition", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Cordova Plugin for Speech Recognition", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -23,2 +23,4 @@ # cordova-plugin-speechrecognition | ||
This plugin requires internet connection. | ||
### isRecognitionAvailable() | ||
@@ -131,2 +133,45 @@ | ||
### Ionic 2 Usage | ||
```typescript | ||
import { SpeechRecognition } from 'ionic-native'; | ||
// Check feature available | ||
SpeechRecognition.isRecognitionAvailable() | ||
.then((available: boolean) => console.log(available)) | ||
// Start the recognition process | ||
SpeechRecognition.startListening(options) | ||
.subscribe( | ||
(matches: Array<string>) => console.log(matches), | ||
(onerror) => console.log('error:', onerror) | ||
) | ||
// Stop the recognition process (iOS only) | ||
SpeechRecognition.stopListening() | ||
// Get the list of supported languages | ||
SpeechRecognition.getSupportedLanguages() | ||
.then( | ||
(languages: Array<string>) => console.log(languages), | ||
(error) => console.log(error) | ||
) | ||
// Check permission | ||
SpeechRecognition.hasPermission() | ||
.then((hasPermission: boolean) => console.log(hasPermission)) | ||
// Request permissions | ||
SpeechRecognition.requestPermission() | ||
.then( | ||
() => console.log('Granted'), | ||
() => console.log('Denied') | ||
) | ||
``` | ||
Required: [ionic-native](https://www.npmjs.com/package/ionic-native) v2.3.0 | ||
See [Ionic Native documentation](https://ionicframework.com/docs/v2/native/speechrecognition/). | ||
## Android Quirks | ||
@@ -133,0 +178,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
37151
3.47%226
24.86%