Audio recorder in Android

// initialize the MediaRecorder
MediaRecorder mediarecorder = new MediaRecorder();
mediarecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mediarecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mediarecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mediarecorder.setOutputFile("/sdcard/myaudiorecord.3gpp");
mediarecorder.prepare();
mediarecorder.start();
//To stop recording use below code..
//mediarecorder.stop();
//mediarecorder.reset();
//After MediaRecorder is no longer needed, release it:
//mediarecorder.release();

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.