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 ...... say()
Forum Updated to NodeBB v4.3 + New Features

QTextToSpeech ...... say()

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 648 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.
  • U Offline
    U Offline
    Ucn_
    wrote on last edited by
    #1

    Hello. I'm trying to implement QTextToSpeech Class. I would like to know how can I get the current reading "word" from "QTextToSpeech::say(const QString &text)" as the reading is asynchronous(?) or get it somehow. I want to get the current "word" for highlighting purposes. I would appreciate any help.

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

      Hi
      Looking over the code
      https://code.woboq.org/qt5/qtspeech/src/tts/qtexttospeech.cpp.html
      it seems the Say is forward to the backend implementation pr platform and
      there seems to be no signal or similar to know the current word.

      U 1 Reply Last reply
      1
      • mrjjM mrjj

        Hi
        Looking over the code
        https://code.woboq.org/qt5/qtspeech/src/tts/qtexttospeech.cpp.html
        it seems the Say is forward to the backend implementation pr platform and
        there seems to be no signal or similar to know the current word.

        U Offline
        U Offline
        Ucn_
        wrote on last edited by
        #3

        @mrjj Is there a way to sync the tts with the text?

        mrjjM W 2 Replies Last reply
        0
        • U Ucn_

          @mrjj Is there a way to sync the tts with the text?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Ucn_
          Hi
          I dont know the module well enough to say for sure but looking over the backend code
          it seems not much information besides playing state that is sent back to the Qt plugins.
          So i would guess on No.

          However, you could ask on the dev mailing list where the Qt devs hang out and see
          if they know a way. (maybe via the backend directly )

          https://lists.qt-project.org/

          1 Reply Last reply
          1
          • U Ucn_

            @mrjj Is there a way to sync the tts with the text?

            W Offline
            W Offline
            wrosecrans
            wrote on last edited by
            #5

            @Ucn_ Nope. QTextToSpeech is a very minimal wrapper around basically just being able to say some text. It avoids the complexities of supporting the different functionality on different platforms, by only exposing the bare minimum subset. To get anything more detailed, you may have to poke at the system specific backends yourself. Or use some portable text to speech library that generates an audio buffer that you can play as audio, if it gives you the relevant data.

            Speech is easy. Actually doing anything with it is surprisingly hard.

            JonBJ 1 Reply Last reply
            2
            • W wrosecrans

              @Ucn_ Nope. QTextToSpeech is a very minimal wrapper around basically just being able to say some text. It avoids the complexities of supporting the different functionality on different platforms, by only exposing the bare minimum subset. To get anything more detailed, you may have to poke at the system specific backends yourself. Or use some portable text to speech library that generates an audio buffer that you can play as audio, if it gives you the relevant data.

              Speech is easy. Actually doing anything with it is surprisingly hard.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @wrosecrans said in QTextToSpeech ...... say():

              Speech is easy. Actually doing anything with it is surprisingly hard.

              Equally true of humans ;)

              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