BassBoost setStrength - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for BassBoost setStrength method.

This code example shows how to use the following methods:release, getRoundedStrength, getStrengthSupported, setStrength
    public void test1_0Strength() throws Exception { 
        boolean result = false;
        String msg = "test1_0Strength()";
        getBassBoost(0); 
        try { 
            if (mBassBoost.getStrengthSupported()) {
                mBassBoost.setStrength((short)TEST_STRENGTH);
                short strength = mBassBoost.getRoundedStrength();
                // allow 10% difference between set strength and rounded strength 
                assertTrue(msg +": got incorrect strength",
                        ((float)strength > (float)TEST_STRENGTH * 0.9f) &&
                        ((float)strength < (float)TEST_STRENGTH * 1.1f));
            } else { 
                short strength = mBassBoost.getRoundedStrength();
                assertTrue(msg +": got incorrect strength", strength >= 0 && strength <= 1000);
            } 
            result = true;
        } catch (IllegalArgumentException e) {
            msg = msg.concat(": Bad parameter value");
            loge(msg, "Bad parameter value");

8
CodeRank
This code example shows how to use the following methods:release, getRoundedStrength, getStrengthSupported, setStrength
    public void test1_0Strength() throws Exception { 
        boolean result = false;
        String msg = "test1_0Strength()";
        getBassBoost(0); 
        try { 
            if (mBassBoost.getStrengthSupported()) {
                mBassBoost.setStrength((short)TEST_STRENGTH);
                short strength = mBassBoost.getRoundedStrength();
                // allow 10% difference between set strength and rounded strength 
                assertTrue(msg +": got incorrect strength",
                        ((float)strength > (float)TEST_STRENGTH * 0.9f) &&
                        ((float)strength < (float)TEST_STRENGTH * 1.1f));
            } else { 
                short strength = mBassBoost.getRoundedStrength();
                assertTrue(msg +": got incorrect strength", strength >= 0 && strength <= 1000);
            } 
            result = true;
        } catch (IllegalArgumentException e) {
            msg = msg.concat(": Bad parameter value");
            loge(msg, "Bad parameter value");

7
CodeRank
This code example shows how to use the following methods:setEnabled, setStrength
					Log.d("test", "bassBoost off");
				} 
			}else if(level > 20){
				bassLevel = (short) level;
				Log.d("test", "bassLevel = " + bassLevel);
				bass = new BassBoost(0, SessionID);
				bass.setEnabled(true);
				bass.setStrength(bassLevel);
				Log.d("test", "bassBoost on");
			} 
		} 
	} 
 
	public int getBassLevel(){ 
		if(!effect_on || bass == null){
			return 0; 
		} 
		return bass.getRoundedStrength();
	} 
 
6
CodeRank
This code example shows how to use the following methods:release, getRoundedStrength, getStrengthSupported, setStrength
    public void test1_0Strength() throws Exception { 
        boolean result = false;
        String msg = "test1_0Strength()";
        getBassBoost(0); 
        try { 
            if (mBassBoost.getStrengthSupported()) {
                mBassBoost.setStrength((short)TEST_STRENGTH);
                short strength = mBassBoost.getRoundedStrength();
                // allow 10% difference between set strength and rounded strength 
                assertTrue(msg +": got incorrect strength",
                        ((float)strength > (float)TEST_STRENGTH * 0.9f) &&
                        ((float)strength < (float)TEST_STRENGTH * 1.1f));
            } else { 
                short strength = mBassBoost.getRoundedStrength();
                assertTrue(msg +": got incorrect strength", strength >= 0 && strength <= 1000);
            } 
            result = true;
        } catch (IllegalArgumentException e) {
            msg = msg.concat(": Bad parameter value");
            loge(msg, "Bad parameter value");

6
CodeRank
setStrength Method Overview
Sets the strength of the bass boost effect.
See Code Examples for other Android BassBoost Methods: