kiwix-android
kiwix-android copied to clipboard
"Read Aloud" Feature on the Wiki Med Offline App
Describe the bug "Read Aloud" Feature on the Wiki Med App Stopped Functioning
*Expected behavior On Clicking the "Read Aloud" feature, the content of the page is meant to be read aloud
Steps to reproduce the behavior:
-
Open the Wiki Med Offline App and any article in it.
-
Click on: 'Menu Bar'
-
Scroll down to: 'Read Aloud'
-
See error : "The Language of this page is not supported or inappropriate language data was not installed. The article may not be properly read."
Screenshots
Environment
- Version of Kiwix Android : 2020-03 Build: 5200810
- Device : Techno Spark 2
- OS version : Android 8.1.0
@mhutti1 @abdulwd @macgills Could you please quickly (before 3.3 release) verify we don't have created a regression here?
Have been trying to resolve this issue on my own, for quite a while now. So I decided to try fixing it by updating my Language Output.
Apparently it worked, after downloading "Google Text-to-speech [UNITED KINGDOM] voice data" on my device; the default language preference on my device is English (United States).
Inadvertently, I also found out that you can change the way the Voice-Output sounds by changing the Voices in the English (United Kingdom)Voice data Options.
@kelson42 This still works fine for me on 3.3
@macgills @AnneChase09 Not sure what do to next, but I suspect a glitch if you have certain locales like en-US.
We could try giving a hint to the users that is better than?
I don't know particularly what we could say? Perhaps a button linking to Google Text To Speech?
@macgills I thought our application install the package automatically! This was at least the behaviour before #1510 has been fixed I guess. What is the new one?
it should try to? That was the result of @mohamedsamehkhalil 's discovery
getFeatures(tts, locale).contains(TextToSpeech.Engine.KEY_FEATURE_NOT_INSTALLED)
if that evaluates true then we show this error message
I thought our application install the package automatically! This was at least the behaviour before #1510 has been fixed I guess.
I believe that before #1764, we never actively requested the package to be installed. the package was installed automatically only if Google TTS engine was used (possibly other engines too). in #1764 I just added that the toast but it should still install the package if Google TTS was used.
My theory is @AnneChase09 was initially using a TTS engine other than Google TTS, so it only showed the toast but did not install the package. which was the expected behaviour even before #1764.
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
Clarifying questions: Is the goal to install TTS automatically if it is not detected? Is there a particular TTS kiwis-android uses?
@jhbiggs At this level, I believe the ideas/comments done earlier should be confirmed. The analysis of the problem should be done. Here a few open questions I have:
- Does the system seems to work correctly today?
- What happens if the either the content or the voice at the country specificities like
pt-PT
for example? - Can we download automatically the voice?
- ....
On initial launch, the readAloud does not appear to have initialized. The first tap shows the error toast, then on second tap the readAloud launches successfully. Perhaps the toast message should read, "Please wait, initializing text-to-speech"?
@jhbiggs what is this init time? How long it takes? Is that normal?
I was wrong, a voice download is causing the delay and error toast.
The if condition on line 119 in KiwixTextToSpeech.kt triggers the toast. The Engine.KEY_FEATURE_NOT_INSTALLED evaluates to true. The line before it, tts.setLanguage(locale), triggers the download which has not yet completed by the time the KEY_FEATURE expression is evaluated. Documentation for the Engine.KEY_FEATURE_NOT_INSTALLED states "the voice may need to download additional data to be fully functional. The download will be triggered by calling TextToSpeech#setVoice(Voice) or TextToSpeech#setLanguage(Locale)." tts.setLanguage(locale) triggers the download.
Currently The Nexus 6 on API 26 shows the error toast and does not launch the new voice. The Pixel 3a API 30 shows the error toast once then launches the appropriate voice.
We can
- Remove the KEY_FEATURE expression; wait for the download to complete as needed; and allow the read-aloud to begin on its own,
- Update the toast message to "voice is downloading, please wait," and handle other potential outcomes, or
- Follow a third and better suggestion I haven't thought of.
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.
Same issue on samsung api 33 with en-us, voice data is not downloaded automatically and the toast error doesn't show which voice data it needs, thankfully i found this page and installing en-uk fixed it for me but the error message should show what exact voice it needs so users can download it manually if needed.