Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTextToSpeech problem with macOS engine

QTextToSpeech problem with macOS engine

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 698 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    quadbyte
    wrote on last edited by quadbyte
    #1

    Hi all,

    I get difference of signal raised when using same Qt 6.6.1 code on macOS 14.2.1 and win10 22H2.

    TEMPLATE = app
    QT = core texttospeech
    
    CONFIG += c++17 cmdline
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
            main.cpp
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    

    source is

    #include <QCoreApplication>
    #include <QtTextToSpeech/QTextToSpeech>
    
    int main(int argc, char *argv[])
    {
       QCoreApplication a(argc, argv);
    
    #if defined (Q_OS_MAC)
       QTextToSpeech speech("macos");
       //QTextToSpeech speech("darwin");
    #else
       QTextToSpeech speech("sapi");
       //QTextToSpeech speech("winrt");
    #endif
    
       QObject::connect(&speech, &QTextToSpeech::stateChanged, [&](QTextToSpeech::State state){
          qDebug() << state;
       });
    
       speech.say("try to speech");
    
       return a.exec();
    }
    

    win10 for engine "sapi" or "winrt" console display :
    QTextToSpeech::Speaking
    QTextToSpeech::Ready

    macOS for engine "macos" console display :
    QTextToSpeech::Speaking

    for engine "darwin" console display nothing !!

    Do you already experienced same issue ? any fix ?

    Q 1 Reply Last reply
    0
    • Q Offline
      Q Offline
      quadbyte
      wrote on last edited by
      #7

      Thanks a lot SGaist to put me on the way. Bad news if graphical side is needed, as my app is pure console one. I check that point...

      SGaistS 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Did you test the C++ example of the module ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • Q quadbyte

          Hi all,

          I get difference of signal raised when using same Qt 6.6.1 code on macOS 14.2.1 and win10 22H2.

          TEMPLATE = app
          QT = core texttospeech
          
          CONFIG += c++17 cmdline
          
          # You can make your code fail to compile if it uses deprecated APIs.
          # In order to do so, uncomment the following line.
          #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
          
          SOURCES += \
                  main.cpp
          
          # Default rules for deployment.
          qnx: target.path = /tmp/$${TARGET}/bin
          else: unix:!android: target.path = /opt/$${TARGET}/bin
          !isEmpty(target.path): INSTALLS += target
          
          

          source is

          #include <QCoreApplication>
          #include <QtTextToSpeech/QTextToSpeech>
          
          int main(int argc, char *argv[])
          {
             QCoreApplication a(argc, argv);
          
          #if defined (Q_OS_MAC)
             QTextToSpeech speech("macos");
             //QTextToSpeech speech("darwin");
          #else
             QTextToSpeech speech("sapi");
             //QTextToSpeech speech("winrt");
          #endif
          
             QObject::connect(&speech, &QTextToSpeech::stateChanged, [&](QTextToSpeech::State state){
                qDebug() << state;
             });
          
             speech.say("try to speech");
          
             return a.exec();
          }
          

          win10 for engine "sapi" or "winrt" console display :
          QTextToSpeech::Speaking
          QTextToSpeech::Ready

          macOS for engine "macos" console display :
          QTextToSpeech::Speaking

          for engine "darwin" console display nothing !!

          Do you already experienced same issue ? any fix ?

          Q Offline
          Q Offline
          quadbyte
          wrote on last edited by quadbyte
          #3

          @quadbyte yes, both exemple are working fine, but both are GUI and not console App.

          SGaistS 1 Reply Last reply
          0
          • Q quadbyte

            @quadbyte yes, both exemple are working fine, but both are GUI and not console App.

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @quadbyte What result do you get if you use a QGuiApplication in place of a QCoreApplication ? (Just to check as I don't have the same version of macOS as you do).

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              quadbyte
              wrote on last edited by quadbyte
              #5

              In that case it's working good !!!
              So does it means that QTextToSpeech events are not correctly handle when in QCoreApplication ?

              SGaistS 1 Reply Last reply
              0
              • Q quadbyte

                In that case it's working good !!!
                So does it means that QTextToSpeech events are not correctly handle when in QCoreApplication ?

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #6

                @quadbyte I haven't dug yet into the code for macOS. From a quick look at the sources I saw that the gui module was linked. That would suggest that some connection to the graphical side might be needed.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • Q Offline
                  Q Offline
                  quadbyte
                  wrote on last edited by
                  #7

                  Thanks a lot SGaist to put me on the way. Bad news if graphical side is needed, as my app is pure console one. I check that point...

                  SGaistS 1 Reply Last reply
                  0
                  • Q quadbyte has marked this topic as solved on
                  • Q quadbyte

                    Thanks a lot SGaist to put me on the way. Bad news if graphical side is needed, as my app is pure console one. I check that point...

                    SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    @quadbyte using QGuiApplication does not mean that you need to show something for your tool to work.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved