Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

await Tts.stop() method behaving differently in android and ios #256

Open
TirumalReddy opened this issue Jan 3, 2024 · 2 comments
Open

Comments

@TirumalReddy
Copy link

useEffect(() => {

Tts.addEventListener('tts-finish', (event) => setIsSpeechFinished(true));

return () => {
  Tts.removeAllListeners('tts-finish');
};

}, []);

I am using tts-finish listener in this way, when i used ' await Tts.stop()' method, In android tts-finish listener not triggering but when it comes to IOS it's triggering. Please comment on this Is this expected behaviour?

Currently using:
react-native-tts version :4.1.0
React Native Version : 0.71.7

Tested in
Android - 13 (one plus)
IOS - 17 (iphone 15)

@Stefanie-Twipe
Copy link

Having the same issue on version 4.1.1

On Android the listener is not being triggered, but on iOS it is.
For me this is not expected behavior..

@f1sh1918
Copy link

f1sh1918 commented Jan 23, 2025

But should the Tts.stop really trigger tts-finish? @TirumalReddy ?

I also investigated some time into this. Because we trigger sentence per sentence the tts for reading a longer text

I just check the native modules and i think the Tts.stop() should trigger tts-cancel as it does on android
But it does not on ios.

The tts-finish event should be triggered if the speak ends automatically.
For me at least it make more sense to be able to distinguish between manually stop and the speak ends after the words were read.

So i would say the issue is that ios doesn't trigger the tts-cancel on Tts.stop()
But it looks like it was the same for the old versions (3.3.0)

Update: Ah i think its related to this #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants