QTextToSpeech error in Qt 6.9.1
-
Hi
I experience a problem when changing from Qt 6.9.0 to 6.9.1
I'm using QTextToSpeech class and it worked before changing to 6.9.1. Using Qt Creator 17.0.0 and Windows 11 (on Android it doesn't produce the same error)
It compiles for both versions without errors, but it fails running when calling say(). Application Output shows
QAudioSink::start: QAudioFormat not supported by QAudioDevice
I wrote a simple demo to illustrate the problem. It works in 6.9.0, but fails for 6.9.1
#include <QCoreApplication> #include <QDebug> #include <QTimer> #include <QtTextToSpeech> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QTextToSpeech tts; tts.say("Hello world! Anyone? Is there anyone out there?"); QTimer::singleShot(10000, &a, &QCoreApplication::quit); return a.exec(); }
Any idea on how to fix this? Or is it a bug in Qt 6.9.1?
-
Hi and welcome to devnet,
That sounds like a regression.
One thing you can check is the default format used in 6.9.0 and compare it with 6.9.1.
-
Thank you for answer
I can retrieve the preferred format and it's the same running both 6.9.0 and 6.9.1:
Prefered format : QAudioFormat( 48000 Hz, 2 Channels, Float Format )I suspect that a valid format is not set by default in 6.9.1. But I can't figure out how to change the format of the default output QAudioDevice. What am I missing?
-
Which engine are you using for the TTS part ?
I just realized I forgot that the QtMultimedia module rewrite changed a lot of things so my original idea might not be that good of an idea.
-
I didn't expect this (but admit that I should have checked it earlier...)
Using 6.9.0: When selecting "winrt" as engine it output the format error, but using "sapi" it works.
Using "winrt" the Application Output shows "QAudioSink::start: QAudioFormat not supported by QAudioDevice"
Still don't know how to fix the problem for winrt, but it's a step forward. Also, the application needs to work for alle engines the end user select in order to support all locales and voices.
It would be interesting to know if this only applies to my setup or if anyone else using Windows 11 and Qt 6.9.1 experience the same issue with this code
I still can't figure out how to set the format of the default output