Skip to content Skip to sidebar Skip to footer

How To Apply Bass Effect Programmatically In Android

I am trying to apply the Bass Effects programmatically by using the following code: BassBoost bassBoost = new BassBoost(0, audioSessionId); bassBoost.setEnabled(true); BassBoost.Se

Solution 1:

Check whether it is supported or not.

bassBoost = newBassBoost(0, 0);
bassBoost.setEnabled(true);

if (bassBoost.getStrengthSupported())
{
    short word1 = bassBoost.getRoundedStrength();
    bassBoost.setStrength(word1);
}

And you can also check that whatever you're testing on supports it (it is device-dependent). You can use:

final Descriptor[] effects = AudioEffect.queryEffects();

// Determine available/supported effects for (final Descriptor effect : effects) {
    Log.d(TAG, effect.name.toString() + ", type: " + effect.type.toString());
}

Post a Comment for "How To Apply Bass Effect Programmatically In Android"