Skip to content

audio.stop() & microphone.stop_recording() should only return when fully stopped #206

Open
@microbit-carlos

Description

@microbit-carlos

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions