-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Description
Tested with v2.1.2 and the lates recording&playback branch.
audio.stop doesn't work in this example:
from microbit import *
while True:
if button_a.is_pressed():
audio.play(Sound.HAPPY, wait=False)
# We can see here that the image is shown as soon as the sound starts playing
display.show(Image.HAPPY)
# But the sound plays to completion
audio.stop()
sleep(200)
sleep(100)
display.clear()Simpler example in REPL (the next prompt >>> appears before the sound naturally ends playing):
>>> audio.play(Sound.HAPPY, wait=False); audio.stop()
>>> audio.play(Sound.HAPPY, wait=False); sleep(10); audio.stop()
>>>
Replacing the play call with audio.play(audio.SoundEffect(duration=3000), wait=False) doesn't work either.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working