summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2022-05-18 09:58:48 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-23 23:32:07 +0000
commitbb2d2dcb780416f4c43b0cdbee2029b44bd135ac (patch)
treee2cb75369d7fb43b9ecaf2e92e968b43a7b6056f
parentbc40e4b4a18d5589d8973ebc7ad4b56d8a223daa (diff)
Flite: try to find voice libraries using their SONAME
When looking for the additional voice libraries, use the SONAME (.so.1) instead of the development library (.so). This is to avoid the need to have development package installed when using flite. Change-Id: I2da824eaa67a2dfe90e99392173840e57647c607 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bcca4fe817eff47ff48e22019d406f3400278cad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/tts/flite/qtexttospeech_flite_processor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp b/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp
index eed23f7..49b23b2 100644
--- a/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp
+++ b/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp
@@ -137,7 +137,7 @@ bool QTextToSpeechProcessorFlite::init()
// We could source the language and perhaps the list of voices we want to load
// (hardcoded below) from an environment variable.
const QLatin1StringView langCode("us");
- const QLatin1StringView libPrefix("flite_cmu_%1_%2");
+ const QLatin1StringView libPrefix("flite_cmu_%1_%2.so.1");
const QLatin1StringView registerPrefix("register_cmu_%1_%2");
const QLatin1StringView unregisterPrefix("unregister_cmu_%1_%2");
@@ -191,7 +191,7 @@ QStringList QTextToSpeechProcessorFlite::fliteAvailableVoices(const QString &lib
ldPaths.removeDuplicates();
}
- const QString libPattern = ("lib"_L1 + libPrefix).arg(langCode).arg("*.so"_L1);
+ const QString libPattern = ("lib"_L1 + libPrefix).arg(langCode).arg("*"_L1);
for (const auto &path : ldPaths) {
QDir dir(path);
if (!dir.isReadable() || dir.isEmpty())
@@ -200,7 +200,7 @@ QStringList QTextToSpeechProcessorFlite::fliteAvailableVoices(const QString &lib
dir.setFilter(QDir::Files);
const QFileInfoList fileList = dir.entryInfoList();
for (const auto &file : fileList) {
- const QString vox = file.fileName().mid(16, file.fileName().lastIndexOf(u'.') - 16);
+ const QString vox = file.fileName().mid(16, file.fileName().indexOf(u'.') - 16);
voices.append(vox);
}
}