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

Refactoring of TTS #945

Merged
merged 19 commits into from
Apr 9, 2020
Merged

Conversation

di72nn
Copy link
Member

@di72nn di72nn commented Apr 1, 2020

A separate PR for TTS. Based on #931.

I tried to improve code and fix potential synchronization issues while keeping the logic mostly intact (except some initialization stages - those had to be changed because TTS didn't work for me).
It is still far from perfect, but that should do for now.

So far I only tested it a bit with Google TTS on an Android 9 emulator and a LineageOS 16 device.

I may make some more improvements, but no promises.

Outstanding issues (in general, not in this PR):

  • Bad handling of interruptions (and pause/resume in general). Discussed in After interruption, TTS restarts at wrong place #939.
  • Reset to the start of the article on interruptions (After interruption, TTS restarts at wrong place #939). As @tyndare mentioned: resume will check that the current text unit is visible on the screen, if it is not the case it will resume at the first text unit visible on the screen.
  • The size of "text units" should be reduced.
  • I'm quite annoyed that text in inline tags is pronounced as separate sentences (e.g. there are pauses around links).
  • Splitting into sentences is dumb: it will split stuff like the U.S. and (it basically splits by any ., ?, ! followed by a space).

@tyndare here are the latest changes in case you want to give it a go. Please comment if you do.

@di72nn
Copy link
Member Author

di72nn commented Apr 2, 2020

Inline elements are no longer separate text units.
Text is split into sentences (not perfect, see the first post).

@di72nn
Copy link
Member Author

di72nn commented Apr 3, 2020

Add rudimentary "emphasizing" for bold/strong/italic text. I didn't find any way to make Android TTS emphasize parts of text, so I just add commas around these emphasized parts to denote them with pauses. I'm not happy with the amount of code (and its complexity) it takes, but oh well.

Also made TTS pronounce alt text or title of images.

@di72nn di72nn force-pushed the service_reorganization-tts branch from a13f503 to eff21ef Compare April 7, 2020 09:56
@di72nn
Copy link
Member Author

di72nn commented Apr 7, 2020

Don't reset reading position if scrolling didn't change since pause (fixes #939 as a third option described here).

Fixed TTS notification icon: a wallabag logo is now displayed instead of a solid square.
Notification action icons are replaced with better looking ones (without outline).

@di72nn di72nn force-pushed the service_reorganization branch from b77fbeb to 3cbb437 Compare April 9, 2020 09:58
@di72nn di72nn force-pushed the service_reorganization-tts branch 2 times, most recently from 363a279 to 4883388 Compare April 9, 2020 10:01
@di72nn di72nn merged commit 4883388 into service_reorganization Apr 9, 2020
@di72nn di72nn deleted the service_reorganization-tts branch April 9, 2020 10:06
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.

1 participant