Q: Qt - [c++] texttospeech is not working when QSound plays
Unsolved
Game Development
-
Hello Dear Qt Forum!
When playing a QSound and triggering a texttospeech->say("some text"), texttospeech seems to be not able to say.
I tried to invoke texttospeech->say(..) in a QMetaObject-call, but did not help.
Is there a possibility to do both "sounds" immediately after each other?
best regards, kevin_d
-
Hi,
How exactly are you doing that ?
On which OS ? -
I am using Qt 5.12.5 on Windows.
auto* sound = new QSound(":/Resources/jingle.wav"); auto* text2Speech = new QTextToSpeech(this); QVector<QLocale> _l = text2Speech->availableLocales(); text2Speech->setLocale(_l[0]); QVector<QVoice> _v = text2Speech->availableVoices(); text2Speech->setVoice(_v.at(0)); sound->play(); text2Speech->say("Welcome");
-
You might want to try QSoundEffect.
That said, 5.12 is deprecated. You should move 5.15 or even better Qt 6.
That said, @JoeCFD has a point, there might be a need for some mixing.