I thought I was doing something wrong in my app so I created a new blank project with npx create-expo-app, installed expo-speech and copied the code from the docs (Speech - Expo Documentation) and got the same problem I was seeing in my app. I’m using expo “expo”: “~49.0.7”,
As soon as I save the code in the new project I get this error:
WARN
new NativeEventEmitter()
was called with a non-null argument without the requiredaddListener
method.WARN
new NativeEventEmitter()
was called with a non-null argument without the requiredremoveListeners
method.WARN Sending
Exponent.speakingStopped
with no listeners registered.
Googling I saw that many developers are having this problem after updating but with other libraries. How could this be solved? Because even though I can hear the voice, it’s not working correctly, onStart and onDone are never triggered:
const speak = () => {
Speech.speak(response, {
onStart: () => setIsPlaying(true),
onDone: () => setIsPlaying(false),
});
};
Hopefully somebody can help me out with this.