How to apply Bass effect programmatically in android

前端 未结 1 1333
说谎
说谎 2021-01-02 17:44

I am trying to apply the Bass Effects programmatically by using the following code:

BassBoost bassBoost = new BassBoost(0, audioSessionId);
         


        
相关标签:
1条回答
  • 2021-01-02 17:53

    Check whether it is supported or not.

    bassBoost = new BassBoost(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());
    }
    
    0 讨论(0)
提交回复
热议问题