I wrote code to play an audio file using python, like below.
def playSound(self):
os.system('start C:\\Users\\unavaras\\Music\\223.wav')
time.sleep(10)
It's playing the audio file recursively and it's not being closed untill i manually close it.
Tried below code as well to stop audio, but didn't work
def playSound(self):
p1 = Popen('start C:\\Users\\unavaras\\Music\\223.wav', shell=True)
time.sleep(5)
p1.kill()
In both cases audio is being played recursively.
Can some help me how I can stop the audio after some time or once it finishes playing.