public void reset(){
  try {
    if (state != State.ERROR) {
      release();
      filePath=null;
      cAmplitude=0;
      if (rUncompressed) {
        audioRecorder=new AudioRecord(aSource,sRate,nChannels + 1,aFormat,bufferSize);
      }
 else {
        mediaRecorder=new MediaRecorder();
        mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
        mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
      }
      state=State.INITIALIZING;
    }
  }
 catch (  Exception e) {
    state=State.ERROR;
  }
}

public void reset ( ) { try { if ( state != State . ERROR ) { release ( ) ; filePath = null ; cAmplitude = 0 ; if ( rUncompressed ) { audioRecorder = new AudioRecord ( aSource , sRate , nChannels + 1 , aFormat , bufferSize ) ; } else { mediaRecorder = new MediaRecorder ( ) ; mediaRecorder . setAudioSource ( MediaRecorder . AudioSource . MIC ) ; mediaRecorder . setOutputFormat ( MediaRecorder . OutputFormat . THREE_GPP ) ; mediaRecorder . setAudioEncoder ( MediaRecorder . AudioEncoder . AMR_NB ) ; } state = State . INITIALIZING ; } } catch ( Exception e ) { state = State . ERROR ; } }
resets the recorder to the initializing state , as if it was just created . in case the class was in recording state , the recording is stopped . in case of exceptions the class is set to the error state .
