ak1394/react-native-tts

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

ikejs opened this issue · 1 comments

ikejs commented

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

  • On node 14.15.4
  • Calling Tts with TouchableOpacity

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', () => {});

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.