app/src/main/java/org/sil/hearthis/WavAudioRecorder.java
/**
	 * 
	 * 
	 * 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.
	 * 
	 */
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.
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 .
public void reset() {
		try {
			if (state != State.ERROR) {
				release();
				filePath = null; 
				audioRecorder = new AudioRecord(mAudioSource, sRate, nChannels, aFormat, mBufferSize);
				if (audioRecorder.getState() != AudioRecord.STATE_INITIALIZED) {
					throw new Exception("AudioRecord initialization failed");
				}
				audioRecorder.setRecordPositionUpdateListener(updateListener);
				audioRecorder.setPositionNotificationPeriod(mPeriodInFrames);
				state = State.INITIALIZING;
			}
		} catch (Exception e) {
			Log.e(WavAudioRecorder.class.getName(), e.getMessage());
			state = State.ERROR;
		}
	}
public void reset ( ) { try { if ( state != State . ERROR ) { release ( ) ; filePath = null ; audioRecorder = new AudioRecord ( mAudioSource , sRate , nChannels , aFormat , mBufferSize ) ; if ( audioRecorder . getState ( ) != AudioRecord . STATE_INITIALIZED ) { throw new Exception ( "AudioRecord initialization failed" ) ; } audioRecorder . setRecordPositionUpdateListener ( updateListener ) ; audioRecorder . setPositionNotificationPeriod ( mPeriodInFrames ) ; state = State . INITIALIZING ; } } catch ( Exception e ) { Log . e ( WavAudioRecorder . class . getName ( ) , e . getMessage ( ) ) ; state = State . ERROR ; } }
// Reset file path