Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Nov 18 '10 at 20:26

This question came from our site for system and network administrators.

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:


share|improve this answer
Hi @neogurb, welcome to SuperUser. Not totally sure you would want to spend too much time answering 2 year old questions though ;) – Julian Knight Mar 7 '13 at 23:13
@JulianKnight I disagree, (one of) the point(s) of SO is to maintain an archive of information. It's not just meant to help the op, but also future visitors (such as myself). neo: I haven't tried it yet (will let you know), but thank you for the info. I have the same goal as fsmaniac – Adam Plocher Jul 22 at 23:28

Generically, no. The data recorded is a relative value (relative to the maximum the setup will record, which varies by mic, sound card, and other factors).

If you have another piece of equipment by which you can calibrate the values output by the sound card then you can figure it out (again, for a particular setup). But without this external reference there's no way to know.

share|improve this answer
That makes sense. Given that, is there a command-line program that will tell me if there is audio coming into the line-in jack, regardless of strength/decibel level/volume? At the end of the day, the decibel level isn't as important - simply knowing whether or not there is a signal on the line is. – fsmaniac Nov 18 '10 at 21:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .