Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When checking microphone SoundEvents there is no way to "stop listening" #169

Open
microbit-carlos opened this issue Mar 5, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@microbit-carlos
Copy link
Contributor

microbit-carlos commented Mar 5, 2024

For example simply running microphone.current_event() turns on the microphone and there is no way to turn it off. Event with the new microphone.stop_recording().

@microbit-carlos microbit-carlos added this to the 2.2.0-beta.2 milestone Mar 5, 2024
@microbit-carlos
Copy link
Contributor Author

@dpgeorge I was wondering if we should change microphone.stop_recording() to simply be microphone.stop() so that it could also apply for this use case where we might not want to listen for microphone events in the background?

@dpgeorge
Copy link
Collaborator

We could add a separate microphone.stop_listening() method. Then the microphone will have two modes that it can independently start/run/stop: listening and recording.

I'm not sure how useful it is to have them separated. Is there ever a case where you always want to be listening for SoundEvents, even during recording, and when recording stops you want to keep listening? Maybe.

Also, if you use microphone.record_into(wait=True) and it stops automatically, or you use microphone.record() (which is blocking), does it implicitly turn off listening when it finishes recording?

@microbit-carlos
Copy link
Contributor Author

Agreed, the user might want to control the microphone events and recording independently, so we should have two independent functions: stop_recording() and stop_listening()

@dpgeorge dpgeorge self-assigned this Mar 25, 2024
@microbit-carlos microbit-carlos added the enhancement New feature or request label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants