LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   log/view microphone sound level to a file? (https://www.linuxquestions.org/questions/linux-software-2/log-view-microphone-sound-level-to-a-file-4175544336/)

pauledd 06-03-2015 03:03 AM

log/view microphone sound level to a file?
 
Hi there
Does anyone know if it is possible to log or output the current sound pressure level of an connected* microphone to the console or an file?

I dont need to record an sound file, just output the sound level without any calibration of the sound pressure scale. I am not aware of any linux tool that can do this.

*via pulseaudio

LADave 06-03-2015 03:58 AM

More relevant features...
 
And while doing this, be able to replicate SLM (sound level meter) features such as impulse (35ms), fast (125 ms) and slow (1 s) integration intervals; RMS vs. peak readings; "A", "C" and other weighting schemes? Perhaps even optionally recording audio clips while a trigger volume level is exceeded, or timed sample clips such as one minute every hour? These all seem like candidates for the SOX "swiss army knife of sound" program.

pauledd 06-03-2015 12:39 PM

Ok thank you, I have found this way to print some values.

Code:

arecord -r 48000 -qd 1 test.wav && sox test.wav -n stat

Samples read:            48000
Length (seconds):      1.000000
Scaled by:        2147483647.0
Maximum amplitude:    0.320313
Minimum amplitude:    -0.343750
Midline amplitude:    -0.011719
Mean    norm:          0.101320
Mean    amplitude:    -0.009666
RMS    amplitude:    0.119220
Maximum delta:        0.125000
Minimum delta:        0.000000
Mean    delta:        0.017759
RMS    delta:        0.022904
Rough  frequency:        1467
Volume adjustment:        2.909

I couldnt figure out how to pipe directly to sox and I am not sure what value fits most likely the input level meter in audacity. Once I find it I will loop the command and execute it every second and write every value to a file.


All times are GMT -5. The time now is 05:59 AM.