How to skip waiting for winsound to end?

Every time winsound is played python waits until audio ends. My goal is to play sound via winsound and continue while sound is still playing. Is there a workaround?

>Solution :

Using multiple threads as @xihtyM mentions is not necessary. The documentation describes several flags for the method winsound.PlaySound.

The one you are looking for is:

import winsound

winsound.PlaySound('*', windsound.SND_ASYNC)

this flag let the method return immediately.

Leave a Reply