4

I am trying to make an android player and a problem occurred while making the equalizer. There is limit of equalizer bands, for example Nexus 5 has 5 band equalizer by default. Several players (such as Poweramp) somehow managed to get 10 band equalizer even on phones that have 5, 6 or 13 bands for example by default.

I am using Equalizer class to attach it to MediaPlayer and generally I understand how that works, but how to make 10 bands on phone that has by default only 5 bands?

So my question is how is this possible and how do some players manage to get 10 band equalizer on all phones, regardless of their system/hardware limit?

Community
  • 1
  • 1

1 Answers1

-1

Like you said frequency depends on hardware on a device. I tested with my Nexus 5 and it has 5 bands with these values:

  • band 1: 30k-120k
  • band 2: 120k-460k
  • band 3: 460k-1.800k
  • band 4: 1.800-7.000k
  • band 5: 7.800k-1

You can get number of bands and presets with this code:

short numberOfBands = equalizer.getNumberOfBands();
short numberOfPresets = equalizer.getNumberOfPresets();

Frequency range of band you can get with this code:

final short minLevel = equalizer.getBandLevelRange()[0]; // get min range
final short maxLevel = equalizer.getBandLevelRange()[1]; // get max range

To show bends you do that like this:

for(short i = 0; i < numberOfBands; i++){
     SeekBar seekBar = ...
     mTextViewMin.setText(minLevel + "");
     mTextViewMax.setText(maxLevel + "");   
}

To initialize Equalizer:

Equalizer equalizer = new Equalizer(0, mediaplayer.getAudioSessionId());
equalizer.setEnabled(true);

Read more about equalizer here: Equalizer Android Developer

MilanNz
  • 1,323
  • 3
  • 12
  • 29
  • 6
    so what are you trying to say? author knows how to get number of bands, you just wrote the same and didn't answer how to get 10 bands – user25 Apr 09 '17 at 12:20