i notice in the Android Default Voice Recorder that can sense how loud is your voice and show it to you in UI parameter .
Can i use this from the intent or how can i program a code that sense the loudness of the voice in Android.
For recording Android android.media.MediaRecorder can be used. All API are listed in this page http://developer.android.com/reference/android/media/MediaRecorder.html. This should solve all your issues. Sample code
MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(PATH_NAME);
recorder.prepare();
recorder.start(); // Recording is now started
...
while(recordingNotOver)
{
int lastMaxAmplitude = recorder.getMaxAmplitude();
// you have the value here in lastMaxAmplitude, do what u want to
}
recorder.stop();
recorder.reset(); // You can reuse the object by going back to setAudioSource() step
recorder.release(); // Now the object cannot be reused
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With