Skip to content

Circle Bar Visualizer

Gautam Chibde edited this page Apr 4, 2018 · 4 revisions

Usage

add CircleBarVisualizer to you XML layout.

<com.chibde.audiovisulaizer.visualizer.CircleBarVisualizer
        android:id="@+id/visualizer"
        android:layout_width="match_parent"
        android:layout_height="250dp"/>

In your java class

CircleBarVisualizer circleBarVisualizer = findViewById(R.id.visualizer);
mediaPlayer = MediaPlayer.create(this, R.raw.you_music);

// set custom color to the line.
circleBarVisualizer.setColor(ContextCompat.getColor(this, R.color.your_color));

// Set you media player to the visualizer. 
circleBarVisualizer.setPlayer(mediaPlayer.getAudioSessionId());

Note

Use of the visualizer requires the permission android.permission.RECORD_AUDIO so make sure to add it to your manifest file.

Clone this wiki locally