Android BassBoost - 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 BassBoost class.

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()";
        getBassBoost(0); 
        try { 
            BassBoost.Settings settings = mBassBoost.getProperties();
            String str = settings.toString();
            settings = new BassBoost.Settings(str);
            mBassBoost.setProperties(settings);
            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");
        } finally { 

9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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();
	} 
 
Full Snippet Info
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: getEnabled, setEnabled, getRoundedStrength
	} 
	 
	public void bassBoost(Context mContext, MediaPlayer mMediaPlayer, boolean enabled) {
		String TAG = "prototype_bassBoost";
		int sessionId = mMediaPlayer.getAudioSessionId();
		BassBoost bb = new BassBoost(0, sessionId);
		if (!enabled) {
			bb.setEnabled(enabled);
			return; 
		} 
		boolean bbEnabled = bb.getEnabled();
		Log.d(TAG, String.format("bb enabled? %s", bbEnabled));
		if (!bbEnabled) {
			Log.d(TAG, "enabling Bass Boost");
			bb.setEnabled(!bbEnabled);
		} 
		/*if (bb.getStrengthSupported()) 
			bb.setStrength((short) BB_LEVEL_LOW);*/ 
		Log.d(TAG, String.format("bass boost set to: %d", bb.getRoundedStrength()));
		 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setEnabled
 
  /*³]©w­«§C­µ¤¶­±ªºmethod*/ 
  private void setupBassBoost() 
  { 
    /*¨ú±oMediaPlayerªºAudioSessionId¨M©w­n±±¨îªº­µ¼Ö*/ 
    myBassBoost = new BassBoost(0,myMediaPlayer.getAudioSessionId());
    myBassBoost.setEnabled(true);
 
    TextView bbTitle = new TextView(this);
    bbTitle.setText("­«§C­µ¡G");
    myLayout.addView(bbTitle);
    /*¨Ï¥ÎSeekBar°µ¬°½Õ¾ã¤u¨ã*/ 
    SeekBar bar = new SeekBar(this);
    /*­«§C­µªº½d³ò¬°0~1000*/ 
    bar.setMax(1000);
    bar.setProgress(0);
    /*³]©wSeekBarªºOnSeekBarChangeListener*/ 
    bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
    { 
      public void onProgressChanged(SeekBar seekBar,int progress,
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: release
            equalizer.release();
        } 
        // BassBoost 
        final BassBoost bassBoost = mBassBoostInstances.remove(audioSession);
        if (bassBoost != null) {
            bassBoost.release();
        } 
        // Virtualizer 
        final Virtualizer virtualizer = mVirtualizerInstances.remove(audioSession);
        if (virtualizer != null) {
            virtualizer.release();
        } 
 
        mPackageSessions.remove(packageName);
    } 
 
    /** 
     * Enables or disables all effects (global enable/disable) for a given context, package name and 
     * audio session. It sets/inits the control mode and preferences and then sets the global 
     * enabled parameter. 
Full Snippet Info
2
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Android BassBoost Methods: