Linux – Determining decibel level of line-in audio


Is there a way (via the command line) to output the decibel level of the audio coming into the soundcard's line-in jack? I want to run a script if the volume/intensity of the audio coming into line-in exceeds a certain threshold.

I've checked the files and sub-directories in /proc/asound and have played with the alsa/a* tools a bit, but I haven't found anything promising.

Any ideas/thoughts?

Best Answer

Try rec, included in sox package, with the silence filter. You can determine a level and duration to start and stop a record. Then, you can use it as a trigger to continue the script.

There is a very good link: