Android PresetReverb - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android PresetReverb class.

This code example shows how to use the following methods:release, getPreset, setPreset
    public void test1_0Preset() throws Exception { 
        boolean result = false;
        String msg = "test1_0Preset()";
        getReverb(0); 
        try { 
            mReverb.setPreset((short)PresetReverb.PRESET_LARGEROOM);
            short preset = mReverb.getPreset();
            assertEquals(msg +": got incorrect preset",
                         (short)PresetReverb.PRESET_LARGEROOM,
                         preset);
            result = true;
        } catch (IllegalArgumentException e) {
            msg = msg.concat(": Bad parameter value");
            loge(msg, "Bad parameter value");
        } catch (UnsupportedOperationException e) {
            msg = msg.concat(": get parameter() rejected");
            loge(msg, "get parameter() rejected");
        } catch (IllegalStateException e) {
            msg = msg.concat("get parameter() called in wrong state");
            loge(msg, "get parameter() called in wrong state");

9
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:release, getProperties, setProperties
    public void test1_1Properties() throws Exception { 
        boolean result = false;
        String msg = "test1_1Properties()";
        getReverb(0); 
        try { 
            PresetReverb.Settings settings = mReverb.getProperties();
            short newPreset = (short)PresetReverb.PRESET_LARGEROOM;
            if (settings.preset == (short)PresetReverb.PRESET_LARGEROOM) {
                newPreset = (short)PresetReverb.PRESET_SMALLROOM;
            } 
            String str = settings.toString();
            settings = new PresetReverb.Settings(str);
            settings.preset = newPreset;
            mReverb.setProperties(settings);
            settings = mReverb.getProperties();
            assertEquals(msg +": setProperties failed", newPreset, settings.preset);
            result = true;
        } catch (IllegalArgumentException e) {
            msg = msg.concat(": Bad parameter value");
            loge(msg, "Bad parameter value");

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getId, release
    public void test0_0ConstructorAndRelease() throws Exception { 
        boolean result = false;
        String msg = "test1_0ConstructorAndRelease()";
        PresetReverb reverb = null;
         try { 
            reverb = new PresetReverb(0, 0);
            assertNotNull(msg + ": could not create PresetReverb", reverb);
            try { 
                assertTrue(msg +": invalid effect ID", (reverb.getId() != 0));
            } catch (IllegalStateException e) {
                msg = msg.concat(": PresetReverb not initialized");
            } 
            result = true;
        } catch (IllegalArgumentException e) {
            msg = msg.concat(": PresetReverb not found");
        } catch (UnsupportedOperationException e) {
            msg = msg.concat(": Effect library not loaded");
        } finally { 
            if (reverb != null) {
                reverb.release();

5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:release
    super.onPause(); 
    if(isFinishing()&&myMediaPlayer!=null)
    { 
      /*release©Ò¦³ª«¥ó*/ 
      myEqualizer.release();
      myPresetReverb.release();
      myBassBoost.release();
      myMediaPlayer.release();
      myMediaPlayer = null;
    } 
  } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getPreset
 
	public int getReverb() { 
		if(!effect_on || reverb == null){
			return PresetReverb.PRESET_NONE;
		} 
		return reverb.getPreset();
	} 
	 
	public void setVolume(int pan,int volume){
		vol_pan = pan;
		vol_lev = volume;
		float temp1 = (float) Math.sqrt(1.0 - (pan*pan)/10000.0)*volume /100;
		float temp2 = (float) Math.sqrt(1.0 - (100 - pan)*(100 - pan)/10000.0)*volume /100;
		mp.setVolume(temp1, temp2);
		 
	} 
	 
	public int getPan(){ 
		return vol_pan;
	} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setEnabled
	} 
	 
	public void stopAudioThru(){ 
		mAudioRecord.stop();
		mAudioTrack.stop();
		if (plateReverb!=null){plateReverb.setEnabled(false);}
			 
	} 
	 
	public void releaseAudio(){ 
		mAudioRecord.release();
		mAudioRecord = null;
		mAudioEventHandler = null;
		mAudioTrack.release();
		mAudioTrack = null;
	} 
	 
	/*========================================================================== 
	 * Listeners and interfaces 
	 *========================================================================== 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:release
        Log.v(TAG, "closeSession(" + context + ", " + packageName + ", " + audioSession + ")");
 
        // PresetReverb 
        final PresetReverb presetReverb = mPresetReverbInstances.remove(audioSession);
        if (presetReverb != null) {
            presetReverb.release();
        } 
        // Equalizer 
        final Equalizer equalizer = mEQInstances.remove(audioSession);
        if (equalizer != null) {
            equalizer.release();
        } 
        // BassBoost 
        final BassBoost bassBoost = mBassBoostInstances.remove(audioSession);
        if (bassBoost != null) {
            bassBoost.release();
        } 
        // Virtualizer 
        final Virtualizer virtualizer = mVirtualizerInstances.remove(audioSession);
        if (virtualizer != null) {
2
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Android PresetReverb Methods: