how to detect if a sound is being played in a python script code example Example: play music from python from playsound import playsound playsound('audio.mp3')