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?

Asked By: Paweł Golimowski



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.

Answered By: MaKaNu
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.