I was making a game in python and wanted to add sound, so I did so. Wondering if there's a way to play the sound but not pause the rest of my code? (was using winsound)
Asked
Active
Viewed 726 times
-1
-
1Hello. Welcome to StackOverflow. Can you please post your code? – Denis Zavedeev Dec 15 '18 at 15:41
1 Answers
1
Use can use winsound.SND_ASYNC to play without stopping the code.
To play:
import winsound
winsound.PlaySound("filename", winsound.SND_ASYNC | winsound.SND_ALIAS )
To stop:
winsound.PlaySound(None, winsound.SND_ASYNC)
Original comment

Cents02
- 77
- 1
- 11