I have the following code and you should be able to listen to the microphone on the phone and use this value to graphically display on some kind of visualizer:
Timer micTimer = new Timer();
micTimer.schedule(new TimerTask(){
@Override
public void run(){
int x = MediaRecorder.getAudioSourceMax();
Log.v("Timer", "" + x);
}
}, 0, 100);
I know that this is probably far from the case. Later in the class, I use the AudioRecorder object to record sound for some subsequent processing. Here I do not want to record anything, just displaying the sound on the visualizer. The log from this code prints the number 6 every 100 ms. Could this have anything to do with this by automatically adjusting the gain? If so, how do I get around this?
source
share