Installing QTSpeech



  • Could someone please point me to instructions on how to install the QtSpeech library? I've been searching for some info on installing it for the past 2 hours, but have only scraped up a little bit of stuff here and there. I've tried using the INSTALL.txt file from https://github.com/srazi/qtspeech. It says:

    Introduction

    QtSpeech uses qmake to build itself as static library.
    qmake is part of a Qt distribution. For Unix Festival
    is required as TTS engine.

    Building QtSpeech

    A) Unix

    sh get-festival.sh
    qmake QtSpeech.pro
    make

    B) Win32/MSVC (this is the one I did)

    Install Speech SDK (Windows XP - Speech SDK 5.1).
    Unfortunately fixes in header files are required.
    Maybe due to outdated version of SDK for Windows XP.

    sphelper.h:
    line 769:
    -const ulLenVendorPreferred = wcslen(pszVendorPreferred);
    +const ULONG ulLenVendorPreferred = wcslen(pszVendorPreferred);
    line 1418:
    -static CoMemCopyWFEX(const WAVEFORMATEX * pSrc, WAVEFORMATEX ** ppCoMemWFEX)
    +static int CoMemCopyWFEX(const WAVEFORMATEX * pSrc, WAVEFORMATEX ** ppCoMemWFEX)
    line 2372:
    -for (const WCHAR * psz = (const WCHAR *)lParam; *psz; psz++) {}
    +const WCHAR * psz; for (psz = (const WCHAR *)lParam; *psz; psz++) {}

    As alternative to avoid building process you can use already built
    QtSpeech.vs2005.lib, but still you will need sapi.lib on linking stage.

    B) Mac OS X

    qmake QtSpeech.pro
    make

    But I don't really know what to do after I finish what it says to do. BTW, I am running a windows 10 64 bit laptop, so I just did what it said to do on the win32/msvc. Anybody know of where to find some instructions or know what to do after that? Thanks.


  • Lifetime Qt Champion

    Hi,

    I'd recommend taking a look at the Qt project QtSpeech module. You can find it here. To install it, it's the usual combo: qmake, nmake, nmake install on windows. You can also open the .pro file in Qt Creator and build it there.



  • Thanks for replying! I was looking at the link you had there, how would I download it? All three of the Clone links near the bottom left of the page don't work when I click on them. Also, how would I use qmake, nmake, and nmake install? I can't seem to find much, all I was able to do was make some makefiles, and then I couldn't figure out what to do from there. Thanks in advance.


  • Lifetime Qt Champion

    Use git to clone the repository.

    What compiler are you using ?



  • Okay, I don't really know what my compiler is. I'm just using qt, and when I tried to do qmake and nmake, it was in the qt console thing. It looked just like cmd. It says Qt 5.4 64 bit for desktop when I hover over the qt cmd thing. Thanks


  • Lifetime Qt Champion

    Then which Qt package did you install ?



  • I don't know that either. But I looked under the help tab and clicked 'about qt creater' and this is what it said there.

    Qt Creator 3.6.0
    Based on Qt 5.5.1 (MSVC 2013, 32 bit)

    Built on Dec 15 2015 01:01:38

    From revision b52c2f91f5

    Copyright 2008-2015 The Qt Company Ltd. All rights reserved.

    The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

    Ohhhhhhh, I think I get it. Do I need to install the mingw compiler for that to work?


  • Lifetime Qt Champion

    What was used to build Qt Creator has nor influence on the Qt version you are using.

    Since I don't know which version of Qt you installed, I can't command on that. What do you have in the Qt Version section of the Build And Run panel of Qt Creator's preferences ?



  • It says: Qt 5.4.2 MSVC2013 64bit


  • Lifetime Qt Champion

    Good

    One simpler alternative to build and install that module is to open the project with Qt Creator and build it with your Qt version (like any standard project).

    To install it, go in the Projects panel and click on "Add build step", select make and in "Make arguments" write install. That should call make install each time you build the module.



  • Okay, so I got that done, but I had to do it with a different qtspeech thing I got from here, because the other one had some errors when I tried it. But anyways, I tried to make a project and use qtspeech but it didn't work. I even put the full path to the header file in the qtspeech folder in the #include. After putting the full path, it doesn't give an error on the include anymore, but when I try to make a qtspeech object

    QtSpeech voice;//it says right here: QtSpeech undeclared identifier.
    voice.say("hello world");
    

    Do I need to do something else after those last steps you told me? Thanks for your time.


  • Moderators

    Is QtSpeech in a namespace?



  • No, at least I don't think so. Do I just have to do something in the project file (the .pro file)? I tried add the qtspeech.h as a header. Like this..

    HEADERS += "C:/Users/Quentin/Downloads/qtspeech-master/QtSpeech.h"
    SOURCES += "C:/Users/Quentin/Downloads/qtspeech-master/QtSpeech_win.cpp" // and added the .cpp file like this.
    

    But nothing I tried worked. How would I go about adding it into a namespace? Thanks.



  • I can't seem to find anything online, they all are showing how to install libraries it they have a .lib file. QtSpeech doesn't seem to have one. Any Idea how I should add it to my project? Thanks.


  • Lifetime Qt Champion

    One thing you can do is to add

    include(C:/Users/Quentin/Downloads/qtspeech-master/qtspeech.pri)
    

    to your .pro file so it will build everything with your project.



  • Since I can't seem to figure out how to get the one working, could you please tell me how to install the one you suggested to me? Seeing now, they both were getting errors likely because I didn't install them properly. Thanks.


  • Lifetime Qt Champion

    What errors are you getting ?



  • The one you sent me:
    :-1: error: Failed to run: perl -w C:\Qt\5.4\msvc2013_64\bin\syncqt.pl -module QtTextToSpeech -version 5.8.0 -outdir C:/Qt/5.4/msvc2013_64 C:/Users/Caiden/qtspeech

    This happens when I open up the qtspeech.pro file and click run.

    And then I get an error when I try to make a project an use the qtspeech library I got from here saying it doesn't recognize the library.
    Basically, I can't figure out how to properly add the library to a project.


  • Lifetime Qt Champion

    Did you clone the repository or download an archive ?



  • I cloned it.


  • Lifetime Qt Champion

    Then, do you have perl installed on your system ?



  • No, I just installed it and now it works, just several warning messages saying GetVersionExW was declared deprecated. How would I include it in a project now? Thanks.



  • Wait, nevermind, it works!! Thanks so much for your time and patience. I can't wait to start finishing up my project tomorrow! Did it just recognize it as a library when I ran it and then it installed it? Or was it something to do with perl, did it install it somehow?


  • Lifetime Qt Champion

    perl was needed to run some script. Once that done, nmake install did install the module within your Qt installation.



  • oh, okay. That makes sense. Thanks again.



  • @SGaist

    Hi I am trying to use the same library but on ubuntu. I am getting the following error.
    build-qtspeech-Desktop_Qt_5_6_0_GCC_64bit-Debug/tests/auto/texttospeech/tst_qtexttospeech does not exist


  • Lifetime Qt Champion

    Looks like you are trying to run the test. Just build the library and call make install.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.