I'm writing a programme for a small computer that will capture audio from line in, encode it as mp3 and pass it on over the network. This will have a graphical interface that should indicate the volume of the audio being captured . This is for letting the user see how loud the output from her connected audio player is—and hopefully be able to indicate that the input volume is too loud.

What would be the easiest way to do this? I was thinking of reusing code from arecord/aplay as I don't really need anything more advanced than that for the capturing.

Erlend Hamberg