Solved QTextToSpeech loses rate?
-
Running the following trivial example:
qDebug() << "rate in" << rate; speechUnit->setRate(rate); auto rateOut = speechUnit->rate(); qDebug() << "rate out" << rateOut;
Outputs the following on Ubuntu:
rate in 0.7 rate out 0
What is going on?
-
Hi,
Good question but your example doesn't allow to reproduce what you get.
You need to provide your Qt version, Ubuntu version and minimal compilable example.
-
What does
qDebug() << "rate out" << speechUnit->rate();
display?
-
@MrShawn 0
-
@Vadi2
can you connect to therateChanged(double)
notifyer signal to see if it's triggered and what value is passed with it? -
@SGaist I can't upload anything to these forums (no permissions), but just take the hello_speak example and modify the setRate() to the following:
void MainWindow::setRate(int rate) { Q_UNUSED(rate); // m_speech->setRate(rate / 10.0); double newrate = 0.7; qDebug() << "rate in" << newrate; m_speech->setRate(newrate); double rateout = m_speech->rate(); qDebug() << "rate out" << rateout; }
Result on Ubuntu 18.04 with 7.3.0 GCC:
rate in 0.7 rate out 0 rate in 0.7 rate out 0 rate in 0.7 rate out 0 rate in 0.7 rate out 0 rate in 0.7 rate out 0 rate in 0.7
Pretty broken... :(
-
@J.Hilk said in QTextToSpeech loses rate?:
connect to the rateChanged(double)
That reports the correct rate passed in
-
what
QTextToSpeechEngine
are you using? -
Also, what version of Qt are you using ?
-
Qt is using
speechd
and this is with Qt 5.11.0 (5.11.2 has the same issue). -
I can confirm this. On my similar ubuntu system rate() is always returning zero, even though the played back speed is changing its rate.
The rateChanged() signal is reflecting the new rate.
On Windows, rate() returns the correct number. -
Try passing in 0.7 on Windows (well, debugger shows 0.6999999999[...]) - I'm getting 0.6 back. Separate issue though.
-
I used a couple of different rates on windows, -0.3, 0.1, 0.7 and they all came through qDebug() correctly.
-
Not for me. On Windows, I get this:
rate in 0.7 rate out 0.6 rate in 0.7 rate out 0.6 rate in 0.7
Qt 5.11.0 using MinGW and the default
sapi
engine. -
@Vadi2 said in QTextToSpeech loses rate?:
Qt is using speechd
Looks like this is a problem of speechd that will be fixed in version 0.9 (currently in dev)
double QTextToSpeechEngineSpeechd::rate() const
collapses to justreturn 0.0;
for previous versions -
OK. Thanks. Would you happen to know what is going on with sapi?