QTextTospeech can't found engines
-
Hello, I work with version QT 5.15.2 on a raspberry pi4.
My goal is to develop software capable of doing TTS (text to speech).
The problem I have is that the availabeEngines() method always returns only one engine namely speechd.
I saw on the blog: https://www.qt.io/blog/qt-speech-coming-to-qt-6.4 that for Linux devices, flite in version 2.3 was also supported.
So I installed this version:texttospeech git:(feature/multi-langs) ✗ flite --version Carnegie Mellon University, Copyright (c) 1999-2016, all rights reserved version: flite-2.3-current Mar 2022 (http://cmuflite.org)
but when I run my application I always only have speechd. here is my code and the output I have:
#include <QCoreApplication> #include <iostream> #include <QTextToSpeech> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); for(auto const& v : QTextToSpeech::availableEngines()){ std::cout << "engine:"<<v.toStdString() << std::endl; } return a.exec(); }
give me
engine:speechd
Why is flite not found ?
Is it a bug in the class on. version 5.15.2 ? -
@_Miro_ Take a look at https://doc.qt.io/qt-6/qttexttospeech-engines.html "Flite" and check whether you have Flite libs in one of the folders mentioned there.
-
@jsulm Something like :
/. /usr /usr/lib /usr/lib/aarch64-linux-gnu /usr/lib/aarch64-linux-gnu/libflite.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_grapheme_lang.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_grapheme_lex.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_indic_lang.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_indic_lex.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_time_awb.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_awb.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_kal.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_kal16.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_rms.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_slt.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_cmulex.so.2.2 /usr/lib/aarch64-linux-gnu/libflite_usenglish.so.2.2 /usr/share /usr/share/doc /usr/share/doc/libflite1 /usr/share/doc/libflite1/changelog.Debian.gz /usr/share/doc/libflite1/copyright /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/libflite1 /usr/lib/aarch64-linux-gnu/libflite.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_grapheme_lang.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_grapheme_lex.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_indic_lang.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_indic_lex.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_time_awb.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_awb.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_kal.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_kal16.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_rms.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmu_us_slt.so.1 /usr/lib/aarch64-linux-gnu/libflite_cmulex.so.1 /usr/lib/aarch64-linux-gnu/libflite_usenglish.so.1
and
export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu:$LD_LIBRARY_PATH ?
Because, I have the same thing
-
@_Miro_ said in QTextTospeech can't found engines:
export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu:$LD_LIBRARY_PATH ?
This is not needed for standard locations.
You can also check what happens when plug-ins are loaded. See https://doc.qt.io/qt-6/debug.html QT_DEBUG_PLUGINS -
@jsulm When I load the plugin, only speechd is found in the keys
➜ export QT_DEBUG_PLUGINS=1 ➜ ./speech QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/aarch64-linux-gnu/qt5/plugins/texttospeech" ... QFactoryLoader::QFactoryLoader() looking at "/usr/lib/aarch64-linux-gnu/qt5/plugins/texttospeech/libqtexttospeech_speechd.so" Found metadata in lib /usr/lib/aarch64-linux-gnu/qt5/plugins/texttospeech/libqtexttospeech_speechd.so, metadata= { "IID": "org.qt-project.qt.speech.tts.plugin/5.0", "MetaData": { "Features": [ ], "Keys": [ "speechd" ], "Provider": "speechd", "Version": 100 }, "archreq": 0, "className": "QTextToSpeechPluginSpeechd", "debug": false, "version": 331520 } Got keys from plugin meta data ("speechd") QFactoryLoader::QFactoryLoader() checking directory path "/home/pi/Desktop/texttospeech/texttospeech" ... engine:speechd
-
@_Miro_ said in QTextTospeech can't found engines:
/usr/lib/aarch64-linux-gnu/qt5/plugins/texttospeech
I guess the texttospeech plug-in was built without Flite support?
-
@jsulm I don't understand: <<. I assume the texttospeech plugin was built without Flite support? >>
Actually, I can't load the engine for example:
QTextToSpeech *tts = new QTextToSpeech("flite");
return -> Text-to-speech plug-in "flite" is not supported.
-
@_Miro_ You have /usr/lib/aarch64-linux-gnu/qt5/plugins/texttospeech/libqtexttospeech_speechd.so but no /usr/lib/aarch64-linux-gnu/qt5/plugins/texttospeech/libqtexttospeech_flite.so (or whatever the exact lib name is for Flite).
-
There seems no flite support according to the doc of 5.15 https://doc.qt.io/qt-5/qtspeech-index.html
The module depends on Speech Dispatcher (libspeechd) on the Linux platform.
-