QTextToSpeech ...... say()
-
Hello. I'm trying to implement QTextToSpeech Class. I would like to know how can I get the current reading "word" from "QTextToSpeech::say(const QString &text)" as the reading is asynchronous(?) or get it somehow. I want to get the current "word" for highlighting purposes. I would appreciate any help.
-
Hi
Looking over the code
https://code.woboq.org/qt5/qtspeech/src/tts/qtexttospeech.cpp.html
it seems the Say is forward to the backend implementation pr platform and
there seems to be no signal or similar to know the current word. -
@Ucn_
Hi
I dont know the module well enough to say for sure but looking over the backend code
it seems not much information besides playing state that is sent back to the Qt plugins.
So i would guess on No.However, you could ask on the dev mailing list where the Qt devs hang out and see
if they know a way. (maybe via the backend directly ) -
@Ucn_ Nope. QTextToSpeech is a very minimal wrapper around basically just being able to say some text. It avoids the complexities of supporting the different functionality on different platforms, by only exposing the bare minimum subset. To get anything more detailed, you may have to poke at the system specific backends yourself. Or use some portable text to speech library that generates an audio buffer that you can play as audio, if it gives you the relevant data.
Speech is easy. Actually doing anything with it is surprisingly hard.
-
@wrosecrans said in QTextToSpeech ...... say():
Speech is easy. Actually doing anything with it is surprisingly hard.
Equally true of humans ;)