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

2916: Add tts on ios #3046

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

2916: Add tts on ios #3046

wants to merge 4 commits into from

Conversation

f1sh1918
Copy link
Contributor

@f1sh1918 f1sh1918 commented Jan 23, 2025

Short description

Ios internally uses the wrong function for stop tts and is therefore sending the wrong Events and even twice.
I don't think we can do here anything, i already checked the native bindings if we could patch there something.
Therefore i added some tweaks here to workaround the event sending issues we have on ios.
Thats really not a clean way so feel free to provide a better solution

Proposed changes

  • implement a suppress function for ios to skip wrongly triggered finish event
  • use pause function instead of stop for ios. This enables to continue at the exact position and avoids event finish issues
  • since manual play next or previous triggers immeditately 'tts-finish' that triggers playNextAuto (Event listener) , i had to adjust the particular function for ios.
  • add a working speech rate for ios

Issues

  • Note at the first sentence in some case it repeats the sentence instead of moving forward. I think thats okay for some beta state.

Side effects

  • hopefully none

Testing

  1. Go to second level text and open "Vorlesefunktion" via "..." Menu. Start and stop reading. Even go next and previous.

Resolved issues

Fixes: #2917


@f1sh1918 f1sh1918 force-pushed the 2916-Add-tts-on-ios branch 3 times, most recently from f66b907 to a418449 Compare January 24, 2025 15:45
@f1sh1918 f1sh1918 marked this pull request as ready for review January 25, 2025 13:58
@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Jan 25, 2025

I really tried to create a less "hacky" solution by introducing this "suppressEvent" function but to use it in all "manual" triggers like previous, next and pause also leads to issues, so i had to use even more hacky workarounds.
Even it seem to work quite fine now for both platforms, i'm aware thats far away from a good solutions, so feel free to challenge that and propose sth better. I really spent a huge amount of hours in trying ;)

Also this ios issue that i linked is opened since ios15 (4years+) i don't expect that this will be fixed soonish tbh.

Base automatically changed from 2916-Add-TTS-on-android to main January 28, 2025 09:59
Copy link
Contributor

@LeandraH LeandraH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, that looks pretty ugly indeed, thank you for explaining at each step of the way why you were doing what, and for slogging through that mess! Tested on real iOS

@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Jan 30, 2025

Wow, that looks pretty ugly indeed, thank you for explaining at each step of the way why you were doing what, and for slogging through that mess! Tested on real iOS

When I realized what the issue is, i should have come to the conclusión to just remove the event listener and readd after stop. So I guess this PR is outdated and we should check Steffens. Sometimes i get lost in the woods 😁

@steffenkleinle steffenkleinle marked this pull request as draft January 30, 2025 15:32
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

Successfully merging this pull request may close these issues.

Add TTS on ios
2 participants