-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Implement Basic Text to Speech #1143
base: main
Are you sure you want to change the base?
Conversation
I wasn't able to implement PAUSE, RESUME, and volume. PAUSE/RESUME: Qt relies on the underlying system's audio engines to perform these operations and Qt has quite some buggy behavior on those engines. I tried for a long time to find solutions but none is compatible with all engines and Qt versions. This leads to the compromise of simply having Speak & STOP. Volume: From what I tested, the Linux "speech" engines' audio doesn't change during the reading, which in my opinion makes it useless. Considering we are shipping cross-platform, it is unreliable to have features that work on one but not on another. If we can find a way to package Qt with a working speech engine, we might be able to implement PAUSE/RESUME. However, I have no idea how to do that. @veloman-yunkan @mgautierfr Do you by any chance have an idea of how hard it would be to package an external library like Flite with Kiwix-Desktop? If it's a huge hurdle and we only get the PAUSE/RESUME, then I wouldn't say the return on the effort is great. The priority for this PR would be to have Kiwix-Desktop be compatible with Qt6.4+, CI builds, and a satisfactory UI/UX given the existing feature. |
@ShaopengLin Thank you very much for your PR. For the moment I'm not able to compile it on my Ubuntu 22.04 but should move soon to 24.04 and hope this will allow me to have Qt 6.4. In the meantime we need to secure the backward compatibility with older version of Qt (both version 5 and 6). Please fix the compilation script and the code to secure that this feature is only activated if Qt6.4 or higher is available, otherwise just deactive the feature in a way both compilation and run are fine. |
e06256d
to
ba921f6
Compare
@kelson42 The compilation is now for Qt 6.4 +. |
@ShaopengLin I have moved to 24.04. Would you be able please to rebase on |
ba921f6
to
f4ad9f8
Compare
@kelson42 Done. From my own testing, TTS from Qt is rather unstable and sometimes crashes the application when used for no apparent reason/pattern at all. I have been trying my best to find out if there is a solution to the core problem, though little information really floats around the internet on this topic. I honestly hope it's just my own computer's issue... Please try it on your machine and see if any crashes or misbehaviors exist. If I cannot figure out why those things occur, rather than relying on Qt's flawed implementation, the goal should be improving screen reader compatibilities. When you test, the dfki packages(if exists) are likely not going to work so select the other ones. |
@kelson42 I have found the root cause to the crashes. Will put up a fixup commit soon... |
6937c65
to
1b9265c
Compare
@kelson42 Should be ready for testing now. |
@ShaopengLin I see the menu entry but nothing happens if I click on it: no sound not bottom bar visible. I use Ubuntu 24.04 wieth Qt 5.15.13. |
@ShaopengLin Then the option should not be available (or grayed) |
@ShaopengLin For me, does not compile with Qt 6.4.2:
|
1b9265c
to
5ce8df9
Compare
@sgourdas Can you please fix compilation regression we have now with Qt6? This is blocking review of this PR. |
@kelson42 was this not fixed with #1212 by @ShaopengLin? |
Actually I don't have Qt6.7+ on my Ubuntu 24.04. How should i test this? @ShaopengLin @sgourdas Do you use a PPA to get the most recent version? |
If I remember correctly I had built it from the git source. Would you like me to test something? |
Speak entire article or selected text with shortcut.
Added UI with stop and close button for TTS
Needed as some voices does not work
d02c351
to
811f88a
Compare
@ShaopengLin Now it compile with Qt6.4, but I have no clue how to activate the TTS (I see nothing in the "Edit" menu for example). Can you please be pretty explicit/precise about all ways to activate the TTS? |
@kelson42 It seems speech library doesn't come directly with the Qt install, which explains why you see nothing at all. I will get back to you with the libraries you need to install. |
@ShaopengLin I have installed |
@kelson42 I believe you also might need I can make it a Qt5 feature as well, not going to be huge changes. I originally actually proposed this to be a Qt 5 feature here. But back here I think you wanted this to be a Qt6.4+ only feature and somehow we both never looked back at Qt 5... |
@ShaopengLin For me this is OK if this is a Qt6 only feature but this will slow down its introduction and will complexify a bit the merging (qt6 switch schedule is still not clear). If we can have the feature in Qt5 without a significant effort, then it would be better. |
ee9fd03
to
e620f79
Compare
@kelson42 Should work on Qt 5 as well now. |
@ShaopengLin I works fine with Qt5, here a few remarks:
Otherwise it seems good for a first version IMHO! |
e620f79
to
619be31
Compare
@kelson42 Done. |
This still fails most of the time (maybe it works only the first time you change) In addition, the two combobox texts should not be selectable and clicking anywhere on them should open it (for the moment you have to click on the combobox arrow to open it) |
75e8cba
to
fb90cb0
Compare
@kelson42 Voice relaunch should be fixed and combobox should be clickable everywhere and no longer be selectable. |
@ShaopengLin It's not necessary to require install (in deb package) of Hopefuly last point from my review: please register in settings the language chosen by the user (one per language)... otherwise the user will have to reconfigure it all the time each time it restarts the app |
@kelson42 To clarify, do you mean store the language chosen per-tab or per-zim |
Neither the first nor the second. just keep track of which voice is used for which lang. And not a new settings, but just remember in the app preferences. |
fb90cb0
to
01dd976
Compare
@kelson42 Voice choices are saved now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from a user perspective
@veloman-yunkan will notify you when code is ready. We can focus on the bigger ones first. |
Fix #44
Functionality takes effect for Qt6.4+
Changes: