0

When you press e it will play the sound, which is fine. But when you try to press it while the sound is active it waits until the sound is done to play it again. I need the sounds to be played at the same time.

import tkinter
from playsound import playsound

root = tkinter.Tk()

def key_pressed(event):
    playsound('sound.wav')

root.bind("<Key>", key_pressed)
root.mainloop()
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Lloyd
  • 95
  • 1
  • 8

1 Answers1

0

Try this:

import tkinter
from playsound import playsound

root = tkinter.Tk()

def key_pressed(event):
    playsound('sound.wav', block=False)

root.bind("<Key>", key_pressed)
root.mainloop()
Lloyd
  • 95
  • 1
  • 8