Skip to content

Instantly share code, notes, and snippets.

@Ajith-Pandian
Created April 26, 2017 07:06
Show Gist options
  • Save Ajith-Pandian/e2eeeb89e3ac7cb10b332b0596bde2fa to your computer and use it in GitHub Desktop.
Save Ajith-Pandian/e2eeeb89e3ac7cb10b332b0596bde2fa to your computer and use it in GitHub Desktop.
MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
recorder.setOutputFile(audioPath);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
try {
recorder.prepare();
recorder.start();l̥
} catch (Exception exception) {
Log.e(TAG, "onStart: ", exception);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment