Skip to content

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

Open

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

Activity

  1. added this to the 2.2.0-beta.1 milestone on May 2, 2024
  2. self-assigned this
    on Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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