Audio Recording File System contd

gR :: Audio Report Form

Interview yourself or someone about the Inauguration, listen back to it, and then submit your report...

Record your audio:

Status: Not Recording

When you are satisfied your recording, press [submit] below.

When you are satisfied your recording, press [submit] below.

private String startRecording (String filename) {

setStatus ("Recording...");

((TextView)findViewById(R.id.btnRecordAudio)).setText("Stop"); String path = null;

if (currentAudioFile != null) {

path = currentAudioFile;

mRecorder = new MediaRecorder();

mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(path); mRecorder.prepare();

mRecorder.start(); return path;

private void playRecording (String path) {

mMediaPlayer = new MediaPlayer(); mMediaPlayer.setDataSource(path); mMediaPlayer.prepare();

mMediaPlayer.start(); }

catch (IOException e) {

e.printStackTrace();

0 0

Post a comment