RustAudio / cpal

Cross-platform audio I/O library in pure Rust
Apache License 2.0
2.7k stars 357 forks source link

How to get mic/system audio volume levels (show 1 bar/2 bar/3 bar) ? #908

Open bliongosari1 opened 2 months ago

bliongosari1 commented 2 months ago

When recording/before recording, is there a way to get the volume of the mic so users know that audio is being picked up. Any examples of this would be great

dheijl commented 2 months ago

You could compute the rms value of the samples you are capturing and visualize that. I do something similar in swyh-rs.