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

Add option to get Sound Level in decibels (dB) #170

Closed
microbit-carlos opened this issue Mar 19, 2024 · 4 comments
Closed

Add option to get Sound Level in decibels (dB) #170

microbit-carlos opened this issue Mar 19, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@microbit-carlos
Copy link
Contributor

CODAL has the option choose between 8-bit and dB for the LevelDetector. We had a couple of requests and it's already built in CODAL, so it'd be good to have it in the next beta.

API Options:

  • Adding an argument to microphone.sound_level(), possibly microphone.sound_level(db=True)?
  • Creating a new function like microphone.sound_level_db()
  • Change units via different method, e.g. microphone.set_sound_level_unit(microphone.SOUND_LEVEL_DB)
    • This would be my least preferred option
@microbit-carlos microbit-carlos added this to the 2.2.0-beta.2 milestone Mar 19, 2024
@dpgeorge
Copy link
Collaborator

My preference would be microphone.sound_level_db(). It's simple. And it makes it very clear what the units are.

@microbit-carlos
Copy link
Contributor Author

@dpgeorge
Copy link
Collaborator

dpgeorge commented Sep 9, 2024

See #221 for an implementation.

@dpgeorge dpgeorge self-assigned this Sep 9, 2024
@dpgeorge
Copy link
Collaborator

Implemented in e876dca

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