I suspect you might be able to do this using Mitovs AudioLab library, which is an excellent audio processing library.
I'm not 100% sure it is capable of measuring the input level though, but I would be surprised if it couldn't. I'll give it a try myself.