Voice recorder

 First on "On activity Create" set these codes:

} private MediaRecorder myAudioRecorder; private void fo4o() {

Then on "Button1" clicked set these 2 codes:

Code 1:

myAudioRecorder = new MediaRecorder(); myAudioRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); myAudioRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); myAudioRecorder.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB); myAudioRecorder.setOutputFile(FilePath);

Code 2:try {

myAudioRecorder.prepare(); myAudioRecorder.start(); } catch (Exception e) {}

Thanks for reading.....

Video tutorial link:


At last, on "Button2" clicked set these codes:

try { myAudioRecorder.stop(); myAudioRecorder.release(); myAudioRecorder = null; } catch(Exception e) {}




Comments

Popular posts from this blog

Code for "Loading Dialog Box"

Code for "Image share from app"