Code example for EnvironmentalReverb

Methods: getDecayHFRatio, getDecayTime, getDensity, getDiffusion, getEnabled, getId, getReflectionsDelay, getReflectionsLevel, getReverbDelay, getReverbLevel

0
		 * setReverbLevel(short -9000-2000) -		Overall volume of late echoes 
		 * setReverbDelay(int 0-100) -				Delay from first "reflection" and echo 
		 */ 
			String TAG = "prototype_reverb";
			int sessionId = mMediaPlayer.getAudioSessionId();
			EnvironmentalReverb rv = new EnvironmentalReverb(0, sessionId);
			 
			if (!enabled) {
				rv.setEnabled(enabled);
				return; 
			} 
			boolean rvEnabled = rv.getEnabled();
			Log.d(TAG, String.format("rv enabled? %s", rvEnabled));
			if (!rvEnabled) {
				Log.d(TAG, "enabling reverb");
				rv.setEnabled(!rvEnabled);
			} 
			// TODO: Instead of arbitrary values, change to constants and "presets" (??????) 
			//rv.setDecayHFRatio((short) 1000); 
			rv.setDecayTime(3000);
			//rv.setDensity((short) 300); 
			//rv.setRoomLevel((short) -2000); 
			//rv.setDiffusion((short) 100); 
			//rv.setReflectionsLevel((short) -4500); 
			//rv.setReflectionsDelay(300); 
			rv.setReverbLevel((short) -5000);
			rv.setReverbDelay(100);
			reverbStat(rv);
			mMediaPlayer.attachAuxEffect(rv.getId());
		 
	} 
	 
	public void reverbStat(EnvironmentalReverb rv) {
		String TAG = "prototype_reverbStat";
		short decayHFRatio = rv.getDecayHFRatio();
		int decayTime = rv.getDecayTime();
		short density = rv.getDensity();
		short diffusion = rv.getDiffusion();
		int reflectionsDelay = rv.getReflectionsDelay();
		short reflectionsLevel = rv.getReflectionsLevel();
		int reverbDelay = rv.getReverbDelay();
		short reverbLevel = rv.getReverbLevel();
		short roomHFLevel = rv.getRoomHFLevel();
		short roomLevel = rv.getRoomLevel();
		Log.d(TAG, String.format(
			"decay hf ratio: %s, decay time: %s, density: %s, diffusion: %s, reflections delay: %s, reflections level: %s, reverb delay: %s, reverb level: %s, room hf level: %s, room level: %s", 
			decayHFRatio,
			decayTime,
			density,