If you want to do your analysis while recording is still in progress, you need to use AudioRecord
, as MediaRecorder
automatically records into a file. AudioRecord
has the disadvantage, that after calling startRecording()
you need to poll the data yourself from the AudioRecord
instance. Also, you must read and process the data fast enough such that the internal buffer is not overrun (look in the logcat output, AudioRecord
will tell you when that happens).