Open
Description
With audio it can take quite a few milliseconds before audio.is_playing()
returns False
:
>>> audio.play(microbit.Sound.HELLO, wait=False); audio.stop(); audio.is_playing()
True
>>> audio.play(microbit.Sound.HELLO, wait=False); audio.stop(); sleep(6); audio.is_playing()
False
With microphone the wait is a lot shorter, but still present:
>>> af = audio.AudioFrame(1000)
>>> microphone.record_into(af, wait=False); microphone.stop_recording(); microphone.is_recording()
True
>>> microphone.record_into(af, wait=False); microphone.stop_recording(); sleep(1); microphone.is_recording()
False