How do I play a Winsound beep while code is running?

65 Views Asked by At

I'm making a sorting algorithm visualizer with Tkinter, but whenever I try to make a "Beep" sound, it stops the program until the sound is finished.

Here's a "paraphrasing" of my code:

import winsound

def visualiser(array):
    for i in array:
        check_conditions(i,other_item)
        winsound.Beep(height,100)
   check_if_sorted(array)

but whenever it "Beeps", it stops the program until the beep is finished. How do I stop this?

0

There are 0 best solutions below