ak1394 / react-native-tts

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

Expo support #218

Closed ET-CS closed 1 year ago

ET-CS commented 1 year ago

Hi, I've been created my first react-native app using the simple Expo instructions: https://reactnative.dev/docs/environment-setup

Now, I've added this lib (react-native-tts)

yarn add react-native-tts

and running link:

react-native link react-native-tts

which hasn't done any change to any of the project files.

Only resulted in warning:

warn Calling react-native link [packageName] is deprecated in favor of autolinking. It will be removed in the next major release. Autolinking documentation: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md

When adding either:

Tts.getInitStatus()

or:

Tts.speak('Hello, world!')

to the project, I am getting an error:

TypeError: null is not an object (evaluating 'TextToSpeech.getInitStatus')

Am I doing anything wrong? or is this library doesn't support expo? Is there any way to make it work?

EshSub commented 1 year ago

Use expo-speech. https://docs.expo.dev/versions/latest/sdk/speech/

ET-CS commented 1 year ago

Thank you!