Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70432

TypeError: this.TTS.speak is not a function Ionic V4

$
0
0

@akit86 wrote:

Hi,
I tried implementing text to speech functionality by following the ionic native tutorial but I get TypeError: this.TTS.speak is not a function when the function is called. Can some tell me what I am doing wrong please,Thanks

constructor(private TTS: TextToSpeech) {
  this.text = 'How are you'; 
  this.locale = 'en-us';
  this.rate = 1;
}

speakText = () =>{
  this.TTS.speak({
    text: this.text,
    locale: this.locale,
    rate: this.rate,
    }).then(() => console.log('Success'))
    .catch((reason: any) => console.log(reason));
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70432

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>