diff options
author | Eric Laurent <elaurent@google.com> | 2010-09-22 08:59:27 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2010-09-22 09:02:23 -0700 |
commit | 71fe631c78756da48662f8ee220fa7b09f5413fb (patch) | |
tree | 98c7dfe5c8af0f587ff461ec03cd2475df434872 /media/tests | |
parent | d45cb72ac0d7d57829ffc9223decb89a5fc42ce2 (diff) | |
download | frameworks_base-71fe631c78756da48662f8ee220fa7b09f5413fb.zip frameworks_base-71fe631c78756da48662f8ee220fa7b09f5413fb.tar.gz frameworks_base-71fe631c78756da48662f8ee220fa7b09f5413fb.tar.bz2 |
Fix broken insert reverb auto tests.
commit 27a2fdfb8ad1606bdb686c35e30ae894dd037588 changed the
insert reverb behavior when it is attached to a track in that
the reverb tail is silenced immediately when the track is paused.
The tests have been modified to test the insert reverb on session 0.
Change-Id: I90c6fec40167966853acfeaa4dec2b96f9e7839f
Diffstat (limited to 'media/tests')
2 files changed, 42 insertions, 8 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEnvReverbTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEnvReverbTest.java index db0db70..d5538f1 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEnvReverbTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaEnvReverbTest.java @@ -414,13 +414,13 @@ public class MediaEnvReverbTest extends ActivityInstrumentationTestCase2<MediaFr EnergyProbe probe = null; AudioEffect vc = null; MediaPlayer mp = null; + AudioEffect rvb = null; AudioManager am = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE); int volume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC); am.setStreamVolume(AudioManager.STREAM_MUSIC, am.getStreamMaxVolume(AudioManager.STREAM_MUSIC), 0); try { - probe = new EnergyProbe(0); // creating a volume controller on output mix ensures that ro.audio.silent mutes // audio after the effects and not before vc = new AudioEffect( @@ -433,11 +433,24 @@ public class MediaEnvReverbTest extends ActivityInstrumentationTestCase2<MediaFr mp = new MediaPlayer(); mp.setDataSource(MediaNames.SINE_200_1000); mp.setAudioStreamType(AudioManager.STREAM_MUSIC); - getReverb(mp.getAudioSessionId()); - mReverb.setRoomLevel((short)0); - mReverb.setReverbLevel((short)0); - mReverb.setDecayTime(2000); - mReverb.setEnabled(true); + + // create reverb with UUID instead of EnvironmentalReverb constructor otherwise an + // auxiliary reverb will be chosen by the effect framework as we are on session 0 + rvb = new AudioEffect( + AudioEffect.EFFECT_TYPE_NULL, + UUID.fromString("c7a511a0-a3bb-11df-860e-0002a5d5c51b"), + 0, + 0); + + rvb.setParameter(EnvironmentalReverb.PARAM_ROOM_LEVEL, (short)0); + rvb.setParameter(EnvironmentalReverb.PARAM_REVERB_LEVEL, (short)0); + rvb.setParameter(EnvironmentalReverb.PARAM_DECAY_TIME, 2000); + rvb.setEnabled(true); + + // create probe after reverb so that it is chained behind the reverb in the + // effect chain + probe = new EnergyProbe(0); + mp.prepare(); mp.start(); Thread.sleep(1000); @@ -460,13 +473,15 @@ public class MediaEnvReverbTest extends ActivityInstrumentationTestCase2<MediaFr loge(msg, "sleep() interrupted"); } finally { - releaseReverb(); if (mp != null) { mp.release(); } if (vc != null) { vc.release(); } + if (rvb != null) { + rvb.release(); + } if (probe != null) { probe.release(); } diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPresetReverbTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPresetReverbTest.java index c14319a..fbd8a78 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPresetReverbTest.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaPresetReverbTest.java @@ -257,13 +257,13 @@ public class MediaPresetReverbTest extends ActivityInstrumentationTestCase2<Medi EnergyProbe probe = null; AudioEffect vc = null; MediaPlayer mp = null; + AudioEffect rvb = null; AudioManager am = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE); int volume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC); am.setStreamVolume(AudioManager.STREAM_MUSIC, am.getStreamMaxVolume(AudioManager.STREAM_MUSIC), 0); try { - probe = new EnergyProbe(0); // creating a volume controller on output mix ensures that ro.audio.silent mutes // audio after the effects and not before vc = new AudioEffect( @@ -279,6 +279,22 @@ public class MediaPresetReverbTest extends ActivityInstrumentationTestCase2<Medi getReverb(mp.getAudioSessionId()); mReverb.setPreset((short)PresetReverb.PRESET_PLATE); mReverb.setEnabled(true); + + // create reverb with UUID instead of PresetReverb constructor otherwise an auxiliary + // reverb will be chosen by the effect framework as we are on session 0 + rvb = new AudioEffect( + AudioEffect.EFFECT_TYPE_NULL, + UUID.fromString("172cdf00-a3bc-11df-a72f-0002a5d5c51b"), + 0, + 0); + + rvb.setParameter(PresetReverb.PARAM_PRESET, PresetReverb.PRESET_PLATE); + rvb.setEnabled(true); + + // create probe after reverb so that it is chained behind the reverb in the + // effect chain + probe = new EnergyProbe(0); + mp.prepare(); mp.start(); Thread.sleep(1000); @@ -308,6 +324,9 @@ public class MediaPresetReverbTest extends ActivityInstrumentationTestCase2<Medi if (vc != null) { vc.release(); } + if (rvb != null) { + rvb.release(); + } if (probe != null) { probe.release(); } |