Jose, the command actually is cordova plugin add GitHub - macdonst/SpeechRecognitionPlugin: W3C Web Speech API - Speech Recognition plugin for PhoneGap and it install the org.apache.cordova.speech.speechrecognition as you can see in plugin directory of the project, didn’t you?
Add recognition as var:
you have :
export class HomePage {
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.
P.