Hi Jonathan,
I found your request actually interesting to play with.
If you use jack, I made a little python script, which only requires you to download and compile a small program, jack-peak, that Robin Gaerus wrote a couple of years ago.
Just download the tar or zip file, unpack it and type make. It might give you some erros, but don't worry: if a "jack-peak" file (without any extension) is created, it means that the build process was successful.
Then, just use the attached "meter.py" script, put it anywere you want, then copy that jack-peak compiled file in the same path, then run
./meter.py -c 1
this will just create a single input port, without jack connection, and will print the output at the default delay rate (100ms).
For example, this command line will record the value every second, connect to the first system audio input and save the data to the file "peaks.txt"
./meter.py -d 1000 -f peaks.txt system:capture_1
By default, the value is a float linear (3 digits after decimal point), from 0 to 1, you can use a custom integer scale, eg from 0 to 1000.
To stop recording, just hit ctrl+c.
For more options, look at the help documentation:
./meter.py -h
I'm actually thinking about converting it to a pure python script, by including jack-python bindings and supporting alsa too, but right now I'm in the middle of another project and I don't have much time for that right now.
Anyway, let me know if this suits your needs.
PS: Robin's program can be used even without this script, but you need to forward its output to a file and then parse every line, since it just rewrites the lines everytime the data is analyzed, which results in an unreadable output or file.
Cheers,
MaurizioB