Android Audio Analysis in Real-time Android Audio Analysis in Real-time android android

Android Audio Analysis in Real-time


I think I have an easier way.

You could use the MediaRecorder 's getMaxAmplitude method.

Anytime your recorder detects a big jump in amplitude, you have detected a corn pop!


Check out this code (ignore the playback part): Playing back sound coming from microphone in real-time

Basically the idea is that you will have to take the value of each 16-bit sample (which corresponds to the value of the wave at that time). Using the sampling rate, you can calculate the time between peaks in volume. I think that might accomplish what you want.


this may be a bit overkill, but there is a framework from MIT media labs called funf: http://code.google.com/p/funf-open-sensing-framework/
They already created classes for audio input and some analysis (FFT and the like), also saving to files or uploading is implemented as far as I've seen, and they handle most of the sensors available on the phone.You can also get inspired from the code they wrote, which I think is pretty good.