ak1394 / react-native-tts

React Native Text-To-Speech library for Android and iOS
603 stars 154 forks source link

Sending `tts-...` with no listeners registered. #194

Closed ikejs closed 2 years ago

ikejs commented 2 years ago

Receiving yellow console warning when calling Tts.speak(word)

Screen Shot 2021-09-15 at 12 19 07 PM

Temporary solution

const ee = new NativeEventEmitter(NativeModules.TextToSpeech);
ee.addListener('tts-start', () => {});
ee.addListener('tts-finish', () => {});
ee.addListener('tts-cancel', () => {});
ak1394 commented 2 years ago

I don't think there is a need to fix it, but thanks for providing way to silence them. You probably could do

Tts.addEventListener('tts-start', () => {});
...

as well.