I has a problem with Speech Recognition in my ionic app.
I use webkitSpeechRecognition and it’s work fine using chrome in the computer with ionic server but, when I build the android app and I try it in my Nexus 5, I obtain the next error: ReferenceError: webkitSpeechRecognition is not defined
It is possible use webkitSpeechRecognition with ionic apps?
If not, there is another way to implement Speech Recognition in android and iOS ionic apps?
after I install the plugin in cordova, what I must do to use this plugin? where the controller is? I’m brand new in cordova, can you give me the tutorial from the start again? because I want to build app with speech recognition too, thanks for your help
Another alternative if you want to implement Web Speech Recognition quickly and without headache in your ionic app, is to use ng-speech-recognition directive: https://github.com/Devniz/ng-speech-recognition
constructor(public navCtrl: NavController, public platform: Platform) {
}
speechToText() {
this.platform.ready().then(() => {
this.recognition = new SpeechRecognition();
this.recognition.lang = 'it-IT';
insert:
export class HomePage {
recognition;
constructor(public navCtrl: NavController, public platform: Platform) { }
speechToText() {
this.platform.ready().then(() => {
this.recognition = new SpeechRecognition();
So you declare recognition as property. I’m sorry, many times we omit some basics…
BTW, I think you have to change this.recognition.lang= “it-IT” with “es-ES” or the exact language you is speaking and the country acronym (example it-CH for italian language in Switzerland).
I had some problem after upgrade from RC2 to RC4. If I compile with RC2 it run, but with RC4 I got, in console, the run time error:
EXCEPTION: Uncaught (in promise): ReferenceError: SpeechRecognition is not defined
I haven’t fixed it yet. I post the help request here.