omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    How to pause Text-to-Speech?

    Pythonista
    speech text-to-speech tts
    2
    2
    1920
    Loading More Posts
    • 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.
    • Stanpol
      Stanpol last edited by

      I am using speech module to say some text. I'd like to stop playing it, then continue from the same place in the text. Whenever I press the play button on my headphones, tts stops, but some other ios app (either music, podcast app etc.) starts playing its own music.

      Any ideas how to deal with it?
      Thanks!

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        There is not an easy way to capture headphone button events that I can think of, though maybe with Objc. However ole had to remove the entitlement to sct like a music player, not sure if that affects headphone buttons too.. You could just use a ui.Button, thst calls speech.stop(). If you need to be able to pause and keep playing, you might need to say one sentance at a time, since there is not a way to tell where you stopped... though you will also have to have a tight loop looking for is_speaking, since there is no way to register a completion handler for each say.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors