What you need to do now, is to decide what level your trigger should be at, then write the logic that says stop monitoring and start recording to a file when that level is exceeded while keeping an eye on he level, once it falls Stop recording to a file and start monitoring.
The main problem I can see is that is that sound is a moving thing, so unless your monitoring for something that you know will be loud and continuous, you're likely to get lots of stops and starts even if the overall level seems quite loud to the ear.
You may want to consider recording for a set time and then check again if you need to keep recording, but you still may hit a trough and start again immediately.
You will only get the best set up once you've tried it.
I know the above quote is a little old now, but I have done exactly this, to an extent. I have written somewhat of an "automatic dictaphone" app that monitor's the mic volume using the AudioRecorder library. It does the following by way of a timer:
1. Monitor's mic volume in a "listening" mode (without recording to a file - more on that shortly).
2. At a certain mic level threshold, it goes into a fake "recording" mode (pretending it was writing to a file - my problem).
3. It stays in "recording mode" as long as audio input to the mic remains above certain level.
4. If audio input drops below the threshold level for longer than 1/2 second, it drops out of "recording mode" and shifts into "playback mode".
5. This "playback mode" is where it would have played the recording file had it been writing one.
6. After this "playback mode" completes (I'm just faking it with another timer at this point), it then goes back into "listening mode".
It works great so far, such as it is.
Ok, so here's my problem: How on earth does one get the AudioRecorder library to write to an MP3 file - as in,
the way it was described when it was posted by its author? Heck, I'd even settle for a WAV file, because the seemingly only available file formats for this library are non-standard stuff that nobody can really use. Is MP3 output even possible?
If not, then here's the real question of the day: Can I monitor Mic levels (with AudioRecorder) and simultaneously record to an MP3 file with another lib that writes to MP3?