# Speech Recognition (SOLVED)

**URL:** <https://forum.ionicframework.com/t/speech-recognition-solved/42205>\
**Category:** ionic-v1\
**Created:** [January 27, 2016, 4:47pm UTC](https://forum.ionicframework.com/t/speech-recognition-solved/42205 "2016-01-27T16:47:21Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![pimol](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@pimol](https://forum.ionicframework.com/u/pimol)\
**Post date:** [December 25, 2016, 7:15pm UTC](https://forum.ionicframework.com/t/speech-recognition-solved/42205/21 "2016-12-25T19:15:13Z")

</div>

Jose, the command actually is cordova plugin add [GitHub - macdonst/SpeechRecognitionPlugin: W3C Web Speech API - Speech Recognition plugin for PhoneGap](https://github.com/macdonst/SpeechRecognitionPlugin) 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](https://forum.ionicframework.com/t/something-different-in-rc3-4-vs-rc2-in-declaration/73590).

P.

---

_[View the full topic](https://forum.ionicframework.com/t/speech-recognition-solved/42205)._
