app/src/main/java/com/example/brian/cantone/AudioRecorder.java
/**
     * Records the audio. Calling startRecording() will override any previously stored recording.
     */
Records the audio. Calling startRecording() will override any previously stored recording.
Records the audio . Calling startRecording () will override any previously stored recording .
public void startRecording() {
        recorder = new MediaRecorder();
        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
        recorder.setOutputFile("tmp/cantone_recording.3gp");
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        try {
            recorder.prepare();
        } catch (IOException e) {
            Log.e(LOG_TAG, "prepare() recorder failed");
        }
        recorder.start();
    }
public void startRecording ( ) { recorder = new MediaRecorder ( ) ; recorder . setAudioSource ( MediaRecorder . AudioSource . MIC ) ; recorder . setOutputFormat ( MediaRecorder . OutputFormat . THREE_GPP ) ; recorder . setOutputFile ( "tmp/cantone_recording.3gp" ) ; recorder . setAudioEncoder ( MediaRecorder . AudioEncoder . AMR_NB ) ; try { recorder . prepare ( ) ; } catch ( IOException e ) { Log . e ( LOG_TAG , "prepare() recorder failed" ) ; } recorder . start ( ) ; }
Records the audio.
Records the audio .
// reinitialize MediaRecorder // see: http://developer.android.com/reference/android/media/MediaRecorder.html // try to prepare recorder // start recording