Newest package in the old version Qt
-
Did you start a MinGW enabled command line to build that volume ?
You can also open it in Qt Creator and build it from there.
@SGaist
And so, I opened the projectqtspeech-opensource-src-5.9.0.pro
in Qt Creator.
I get an errorflite/flite.h: No such file or directory #include <flite/flite.h> ^
I suspect that in the future there will be errors related to the lack of
sapi.h
,atlbase.h
.
I solved the problem with thesapi
, but for theATL
I will have to install the visual studio, which I do not want to do.
Now I use Qt 5.6.1 MinGW -
You might what to try with a more recent version. You should check with the 5.11 branch.
By the way, do you have
flite
installed ? -
You might what to try with a more recent version. You should check with the 5.11 branch.
By the way, do you have
flite
installed ?@SGaist
I hardly installed a new Qt, engines and voices. But there was a problem:
If I run from the Qt Creator, everything works fine. But I tried to start directly, having previously collected the libraries withwindeployqt.exe
. There is no sound for some reason .. The app does not see a single voice -
What exact error do you get ?
-
@SGaist
I run the application without Qt Creator, so I can not get the debug output. The application works without errors, just a list of votes is empty (I bring this list to the QComboBox).
But if I run the same program through Creator, the list of votes is full. -
How are you filing that QComboBox ?
-
QVector<QVoice> m_voices = speech.getAvailableVoices(); QVoice currentVoice = speech.getVoice(); foreach (const QVoice &voice, m_voices) { ui->speechVoices->addItem(QString("%1 - %2 - %3").arg(voice.name()) .arg(QVoice::genderName(voice.gender())) .arg(QVoice::ageName(voice.age()))); if (voice.name() == currentVoice.name()) ui->speechVoices->setCurrentIndex(ui->speechVoices->count() - 1); }
class SpeechWorker:
// .h #ifndef SPEECHWORKER_H #define SPEECHWORKER_H #include <QtTextToSpeech> #include <QLocale> class SpeechWorker { QTextToSpeech m_speech; public: SpeechWorker(); ~SpeechWorker() {} void say(const QString &text, bool stopPrevious = false){ if (stopPrevious) m_speech.stop(); m_speech.say(text); } QVector<QVoice> getAvailableVoices(){ return m_speech.availableVoices(); } QVoice getVoice(){ return m_speech.voice(); } void setVoice(int index){ if((m_speech.availableVoices().size() < index) || (index < 0)) return; m_speech.setVoice(m_speech.availableVoices().at(index)); } }; extern SpeechWorker speech; #endif // SPEECHWORKER_H // .cpp #include "speechworker.h" SpeechWorker speech; SpeechWorker::SpeechWorker() { m_speech.setLocale(QLocale(QLocale::Russian, QLocale::RussianFederation)); m_speech.setRate(0.4); //скорость от -1 до 1 m_speech.setPitch(0.2); //высота голоса от -1 до 1 m_speech.setVolume(1.0); //громкость от 0 до 1 }
I noticed an interesting thing. I put the file
hello_speak.exe
from example next to my executable file and dll's, it works fine. -
You can start your application with the
QT_DEBUG_PLUGINS
environment variable set to 1 to see if there's any information about that plugin that might be useful. -
You can start your application with the
QT_DEBUG_PLUGINS
environment variable set to 1 to see if there's any information about that plugin that might be useful.@SGaist
I did#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { qputenv("QT_DEBUG_PLUGINS", QByteArray("1")); QApplication app(argc, argv); app.setApplicationDisplayName("ПАЗИ-100"); QFont font = app.font(); font.setPointSize(13); app.setFont(font); MainWindow w; //w.setWindowFlags(Qt::CustomizeWindowHint); w.show(); return app.exec(); }
But he did not receive any messages. As before, my application does not see voices, and the application
hello_speak.exe
, which is in the same directory, sees everything fine. -
Are you starting the application from the command line ?
If the other one is working, you should compare your code with it to see if you are doing something different.
-
Are you starting the application from the command line ?
If the other one is working, you should compare your code with it to see if you are doing something different.
@SGaist said in Newest package in the old version Qt:
Are you starting the application from the command line ?
Sorry, I did wrong.
I added to the .pro fileCONFIG += console
and received a messageNo text-to-speech plug-ins were found.
@SGaist said in Newest package in the old version Qt:
you should compare your code
I compared and still compare. I do not see the difference: (
-
Then I'd check with Dependency Walker if there's anything different in the libraries linked to both applications.
-
Then I'd check with Dependency Walker if there's anything different in the libraries linked to both applications.
@SGaist
It seems I solved this problem!
windeployqt
got me files in this formc:\PAZI100\audio c:\PAZI100\bearer c:\PAZI100\config.ini c:\PAZI100\D3Dcompiler_47.dll c:\PAZI100\hello_speak.exe c:\PAZI100\iconengines c:\PAZI100\imageformats c:\PAZI100\libEGL.dll c:\PAZI100\libgcc_s_dw2-1.dll c:\PAZI100\libGLESV2.dll c:\PAZI100\libstdc++-6.dll c:\PAZI100\libwinpthread-1.dll c:\PAZI100\mediaservice c:\PAZI100\opengl32sw.dll c:\PAZI100\Pazi100.exe c:\PAZI100\platforms c:\PAZI100\playlistformats c:\PAZI100\printsupport c:\PAZI100\Qt5Core.dll c:\PAZI100\Qt5Gui.dll c:\PAZI100\Qt5Multimedia.dll c:\PAZI100\Qt5Network.dll c:\PAZI100\Qt5PrintSupport.dll c:\PAZI100\Qt5SerialPort.dll c:\PAZI100\Qt5Svg.dll c:\PAZI100\Qt5TextToSpeech.dll c:\PAZI100\Qt5Widgets.dll c:\PAZI100\texttospeech c:\PAZI100\translations c:\PAZI100\audio\qtaudio_windows.dll c:\PAZI100\bearer\qgenericbearer.dll c:\PAZI100\bearer\qnativewifibearer.dll c:\PAZI100\iconengines\qsvgicon.dll c:\PAZI100\imageformats\qgif.dll c:\PAZI100\imageformats\qicns.dll ... c:\PAZI100\mediaservice\dsengine.dll c:\PAZI100\mediaservice\qtmedia_audioengine.dll c:\PAZI100\platforms\qwindows.dll c:\PAZI100\playlistformats\qtmultimedia_m3u.dll c:\PAZI100\printsupport\windowsprintersupport.dll >>> Wrong: c:\PAZI100\texttospeech\qtexttospeech_sapi.dll c:\PAZI100\translations\qt_bg.qm ...
I added a folder and voices appeared.
c:\PAZI100>dir /s /b c:\PAZI100\audio c:\PAZI100\bearer c:\PAZI100\config.ini c:\PAZI100\D3Dcompiler_47.dll c:\PAZI100\hello_speak.exe c:\PAZI100\iconengines c:\PAZI100\imageformats c:\PAZI100\libEGL.dll c:\PAZI100\libgcc_s_dw2-1.dll c:\PAZI100\libGLESV2.dll c:\PAZI100\libstdc++-6.dll c:\PAZI100\libwinpthread-1.dll c:\PAZI100\mediaservice c:\PAZI100\opengl32sw.dll c:\PAZI100\Pazi100.exe c:\PAZI100\platforms c:\PAZI100\playlistformats c:\PAZI100\plugins c:\PAZI100\Qt5Core.dll c:\PAZI100\Qt5Gui.dll c:\PAZI100\Qt5Multimedia.dll c:\PAZI100\Qt5Network.dll c:\PAZI100\Qt5PrintSupport.dll c:\PAZI100\Qt5SerialPort.dll c:\PAZI100\Qt5Svg.dll c:\PAZI100\Qt5TextToSpeech.dll c:\PAZI100\Qt5Widgets.dll c:\PAZI100\translations c:\PAZI100\audio\qtaudio_windows.dll c:\PAZI100\bearer\qgenericbearer.dll c:\PAZI100\bearer\qnativewifibearer.dll c:\PAZI100\iconengines\qsvgicon.dll c:\PAZI100\imageformats\qgif.dll ... c:\PAZI100\mediaservice\dsengine.dll c:\PAZI100\mediaservice\qtmedia_audioengine.dll c:\PAZI100\platforms\qwindows.dll c:\PAZI100\playlistformats\qtmultimedia_m3u.dll c:\PAZI100\plugins\printsupport c:\PAZI100\plugins\texttospeech c:\PAZI100\plugins\printsupport\windowsprintersupport.dll >>> Right: c:\PAZI100\plugins\texttospeech\qtexttospeech_sapi.dll c:\PAZI100\translations\qt_bg.qm ...
After replacing the folders, the program
hello_speak.exe
still worked. It's strange that two programs behave differently.
Thanks a lot for your help!