app/src/main/java/org/sil/hearthis/WavAudioRecorder.java
/**
	 * 
	 * 
	 *  Releases the resources associated with this class, and removes the unnecessary files, when necessary
	 *  
	 */
Releases the resources associated with this class, and removes the unnecessary files, when necessary
Releases the resources associated with this class and removes the unnecessary files when necessary
public void release() {
		if (state == State.RECORDING) {
			stop();
		} else {
			if (state == State.READY){
				try {
					randomAccessWriter.close(); 
				} catch (IOException e) {
					Log.e(WavAudioRecorder.class.getName(), "I/O exception occured while closing output file");
				}
				(new File(filePath)).delete();
			}
		}
		if (audioRecorder != null) {
			audioRecorder.release();
		}
	}
public void release ( ) { if ( state == State . RECORDING ) { stop ( ) ; } else { if ( state == State . READY ) { try { randomAccessWriter . close ( ) ; } catch ( IOException e ) { Log . e ( WavAudioRecorder . class . getName ( ) , "I/O exception occured while closing output file" ) ; } ( new File ( filePath ) ) . delete ( ) ; } } if ( audioRecorder != null ) { audioRecorder . release ( ) ; } }
// Remove prepared file