Skip to content

Instantly share code, notes, and snippets.

@dallarosa
Created January 26, 2011 07:10
Show Gist options
  • Save dallarosa/796356 to your computer and use it in GitHub Desktop.
Save dallarosa/796356 to your computer and use it in GitHub Desktop.
audio recording method
MediaRecorder recorder = new MediaRecorder();
recorder.reset();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile("test/tmp.3gp");
try {
recorder.prepare();
} catch (IllegalStateException e) {
e.printStackTrace();
Log.i("lala", "IllegalStateException");
} catch (IOException e) {
e.printStackTrace();
Log.i("lala", "IOException");
}
recorder.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment