vilicvane / cordova-plugin-tts

Cordova Text-to-Speech Plugin (Maintainer WANTED!)
177 stars 138 forks source link

TTS works even if the app is minimised or removed from background #99

Open Nikhil-Daffodil opened 5 years ago

Nikhil-Daffodil commented 5 years ago

Firstly i found that stop() is not working in this , so after google it i found a hack to call start() with empty string.

But another issue that i face is that TTS doe not stop i close the app or minimise it, it will still continue speaking untill it speak the provided string.

` // To Start TTS startSpeech() { this.isSpeechActive = true; this.tts.speak(this.cardData.description) .then(() => { console.log('Success'); this.isSpeechActive = false; }) .catch((reason: any) => { console.log(reason); this.isSpeechActive = false; }); }

//To Stop TTS stopSpeech() { this.isSpeechActive = false; this.tts.speak('') .then(() => console.log('Success')) .catch((reason: any) => console.log(reason)); }`