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.


    Sound effect not stopping

    Pythonista
    2
    3
    2677
    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.
    • starrshaw
      starrshaw last edited by

      Hi, can anyone please help me with this sound issue... my sound plays fine, but will not stop. I tried many different solutions but just can not get the play to stop.

      import sound, time
      y = "room_One.mp3"
      x = sound.play_effect(y)
      sound.play_effect(y)
      time.sleep(5)
      sound.stop_effect(x)

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

        @starrshaw the sound is being played twice but the call to stop it playing is only made once.

        import sound, time
        y = "room_One.mp3"
        x = sound.play_effect(y)
        sound.play_effect(y)  # <- This call can be removed
        time.sleep(5)
        sound.stop_effect(x)
        
        1 Reply Last reply Reply Quote 0
        • starrshaw
          starrshaw last edited by

          Thanks Cethric! That was it!

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