LesleyH84
LesleyH84

Reputation: 1

Why is winsound.Beep in Python so delayed on laptop speakers?

I have an issue where the winsound.Beep function has an extremely high latency on my Windows 10 laptop speakers. It is so bad that the terminal would have completed execution of my code and then the beep sound would continue in the background(an audio buffer type effect). If I plug in USB headphones the sound functions properly i.e. one beep every second as specified in my code. I am using VS code as an editor.

I've:

Code:

for j in range(duration,0,-1):
        winsound.Beep(1000,250)
        print(str(j) + ' secs')
        time.sleep(0.75)

I read winsound in python - low latency on monitor, high latency on laptop why?, but that wasn't answered.

Upvotes: 0

Views: 529

Answers (0)

Related Questions