Giter Site home page Giter Site logo

androidsourcetools / androidequalizer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bullheadandplato/androidequalizer

1.0 0.0 0.0 6.33 MB

Android Equalizer View that can also manage the audio track frequencies

License: Apache License 2.0

Java 100.00%

androidequalizer's Introduction

AndroidEqualizer

Android Equalizer View that can also manage the audio track frequencies

Add Equalizer in your Android app

How To Use

STEP 1

In settings.gradle you can add the repositories you want to add to the project:

repositories {
        google()
        jcenter() // Warning: this repository is going to shut down soon
        mavenCentral()
        maven { url 'https://www.jitpack.io' } // this is the line to be added
    }

and:

dependencies {
      implementation 'com.github.bullheadandplato:AndroidEqualizer:2.2'
}

if not using AndroidX. it will not have DialogEqualizerFragment or any other improvements

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

STEP 2

For Equalizer in dialog

 DialogEqualizerFragment fragment = DialogEqualizerFragment.newBuilder()
                    .setAudioSessionId(sessionId)
                    .themeColor(ContextCompat.getColor(this, R.color.primaryColor))
                    .textColor(ContextCompat.getColor(this, R.color.textColor))
                    .accentAlpha(ContextCompat.getColor(this, R.color.playingCardColor))
                    .darkColor(ContextCompat.getColor(this, R.color.primaryDarkColor))
                    .setAccentColor(ContextCompat.getColor(this, R.color.secondaryColor))
                    .build();
            fragment.show(getSupportFragmentManager(), "eq");

For Equalizer in your view

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" />
        

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

androidequalizer's People

Contributors

ayoubanbara avatar bullheadandplato avatar kl3jvi avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.