title: How to stop a sound that is playing in Python?
body: <p>So I have code that looks like this:</p>
  
  <pre><code>    import winsound
      from msvcrt import getch
  
      sound_path = "Path to sound"
  
      while True:
          key= ord(getch())
          if key == 27:
              break
          if key == 113: #theq key
              winsound.PlaySound(sound_path, winsound.SND_FILENAME)
  </code></pre>
  
  <p>So right now if I press the 'q' key, it plays the corresponding sound like it should. However if I keep pressing the 'q' key before the current sound is done playing, it will play after the current sound is finished. How would I have it so upon pressing the 'q' button, it would stop the current noise and play the next one?</p>