Forum Archive

Sound effect not stopping

starrshaw

Hi, can anyone please help me with this sound issue... my sound plays fine, but will not stop. I tried many different solutions but just can not get the play to stop.

import sound, time
y = "room_One.mp3"
x = sound.play_effect(y)
sound.play_effect(y)
time.sleep(5)
sound.stop_effect(x)

Cethric

@starrshaw the sound is being played twice but the call to stop it playing is only made once.

import sound, time
y = "room_One.mp3"
x = sound.play_effect(y)
sound.play_effect(y)  # <- This call can be removed
time.sleep(5)
sound.stop_effect(x)
starrshaw

Thanks Cethric! That was it!