Code example for MediaRecorder

Methods: releasestop

0
	} 
	 
	@Kroll.method 
	public void stop() { 
		if (recorder != null) {
			recorder.stop();
			recorder.release();
			recorder = null;
		} 
	} 
	 
	// Properties 
	@Kroll.getProperty 
	public int getSoundAmplitude() { 
		if (recorder != null) {
			try { 
				// Convert from 16-bit sample value to dBFS 
				return (int)(20.0 * Math.log10((double)recorder.getMaxAmplitude() / 32767.0));
			} catch (RuntimeException e) {
			} 
		}