How to implement equalizer in android

I need to implement Equalizer in android, and also find the source code here

But I have no idea about NumberOfBands and BandLevelRange (what are they?) And how can I handle them.

This code I showed that you are from the source code mentioned by me.

eq = new Equalizer(0, 0);

        if (eq != null)
        {
            eq.setEnabled(true);

            int num_bands = eq.getNumberOfBands();

            num_sliders = num_bands;

            short r[] = eq.getBandLevelRange();

            min_level = r[0];

            max_level = r[1];

            for (int i = 0; i < num_sliders && i < MAX_SLIDERS; i++) 
            {
                int[] freq_range = eq.getBandFreqRange((short) i);

                sliders[i].setOnSeekBarChangeListener(this);

                slider_labels[i].setText(formatBandLabel(freq_range));
            }

        }

        for (int i = num_sliders; i < MAX_SLIDERS; i++) 
        {
            sliders[i].setVisibility(View.GONE);

            slider_labels[i].setVisibility(View.GONE);
        }

        bb = new BassBoost(0, 0);

        if (bb != null) 
        {
        }
        else 
        {
            bass_boost.setVisibility(View.GONE);

            bass_boost_label.setVisibility(View.GONE);
        }

        updateUI();

And in onProgresschanged it does

@Override
    public void onProgressChanged(SeekBar seekBar, int level, boolean fromTouch) {

        if (seekBar == bass_boost) {
            bb.setEnabled(level > 0 ? true : false);

            bb.setStrength((short) level); // Already in the right range 0-1000
        } else if (eq != null) {
            int new_level = min_level + (max_level - min_level) * level / 100;

            for (int i = 0; i < num_sliders; i++) {
                if (sliders[i] == seekBar) {
                    eq.setBandLevel((short) i, (short) new_level);

                    break;
                }
            }
        }

    }

Desired equilizer

I need to create it, similar to the image above, but not that 60, 3k, 14k, but that -15db to + 15db.

Edit

I understand what he does, he changes the frequency of each group, but what happens when we increase or decrease the frequency. At what stage do I get the maximum sound output and at what stage do I get the minimum sound.

+3
source share

All Articles