/AndroidEqualizer

Android Equalizer View that can also manage the audio track frequencies

Primary LanguageJavaApache License 2.0Apache-2.0

AndroidEqualizer

Android Equalizer View that can also manage the audio track frequencies

Add Equalizer in your Android app


How To Use

STEP 1

Add it to your build.gradle with:

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

and:

dependencies {
     implementation 'com.github.mosamabinomar:AndroidEqualizer:1.0'
}

STEP 2

Create a frame in your layout file.

<FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        android:id="@+id/eqFrame"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
        

STEP 3

In your Activity class

 int sessionId = mediaPlayer.getAudioSessionId();
        mediaPlayer.setLooping(true);
        EqualizerFragment equalizerFragment = EqualizerFragment.newBuilder()
                .setAccentColor(Color.parseColor("#4caf50"))
                .setAudioSessionId(sessionId)
                .build();
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.eqFrame, equalizerFragment)
                .commit();

This work is mostly borrowed from https://github.com/harjot-oberai/MusicDNA