Speech Recognition
This plugin does speech recognition using cloud services
https://github.com/pbakondy/cordova-plugin-speechrecognition
Stuck on a Cordova issue?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.
Installation#
- Capacitor
- Cordova
- Enterprise
$ npm install cordova-plugin-speechrecognition $ npm install @ionic-native/speech-recognition $ ionic cap sync
$ ionic cordova plugin add cordova-plugin-speechrecognition $ npm install @ionic-native/speech-recognition
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us
#
Supported Platforms- Android
- iOS
#
Usage#
ReactLearn more about using Ionic Native components in React
#
Angularimport { SpeechRecognition } from '@ionic-native/speech-recognition/ngx';
constructor(private speechRecognition: SpeechRecognition) { }
...
// Check feature availablethis.speechRecognition.isRecognitionAvailable() .then((available: boolean) => console.log(available))
// Start the recognition processthis.speechRecognition.startListening(options) .subscribe( (matches: string[]) => console.log(matches), (onerror) => console.log('error:', onerror) )
// Stop the recognition process (iOS only)this.speechRecognition.stopListening()
// Get the list of supported languagesthis.speechRecognition.getSupportedLanguages() .then( (languages: string[]) => console.log(languages), (error) => console.log(error) )
// Check permissionthis.speechRecognition.hasPermission() .then((hasPermission: boolean) => console.log(hasPermission))
// Request permissionsthis.speechRecognition.requestPermission() .then( () => console.log('Granted'), () => console.log('Denied') )