While, "strong_beat.play()" is in the while loop, it stops running
*import simpleaudio, time, math
temp = 0
strong_beat = simpleaudio.WaveObject.from_wave_file('metronome2.wav')
while temp<20:
strong_beat.play()
time.sleep(0.5)
temp = temp + 1
print (temp)*
however if I remove it it continues to run properly
With:With the function
Without:Without the function
I don't know if there's a fundamental thing I don't understand, but the internet was not helping and I don't really know what to do.
I have limited knowledge of python, but I don't remember this being a problem in the past.
strong_beat.play()
is the only change you made to this code? Perhaps you also made some other change that you didn't show?.play()
on the same object twice isn't allowed, and causes your program to exit when you try. But it's odd that it would exit without any kind of error message.