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

Get sound decibel of microphone #322

Open
BigGitWorld opened this issue Mar 27, 2023 · 2 comments
Open

Get sound decibel of microphone #322

BigGitWorld opened this issue Mar 27, 2023 · 2 comments

Comments

@BigGitWorld
Copy link

BigGitWorld commented Mar 27, 2023

Hello.
How can I measure the decibel level of a microphone connected to a Raspberry Pi (inside of a flutter-pi based application)?
I found the flutter package noise_meter, but it does not have linux implementation.

@BigGitWorld
Copy link
Author

BigGitWorld commented Jul 5, 2023

@ardera can you please suggest me a solution?

@ardera
Copy link
Owner

ardera commented Jul 21, 2023

That's definitely something you'll have to write a plugin for, unfortunately it's not possible in pure dart (except if you want a hacky solution)

For the implementation, I'd recommend you use gstreamer and the level plugin to detect the noise level.

As a proof of concept, this here will log the noise level of some auto-detected microphone to console (look at the message: RMS ...dB logs):

GST_DEBUG=level:7 gst-launch-1.0 autoaudiosrc ! audioconvert ! level post-messages=true ! fakesink sync=true

If you want a really really hacky solution you can just run that with normal dart Process.start and use regexes to extract the noise level from the process output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants