Skip to content

Circle Visualizer

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

Usage

<com.chibde.audiovisulaizer.visualizer.CircleVisualizer
        android:id="@+id/visualizer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/

in your java class

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

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

// Customize the size of the circle. by default multipliers is 1.
circleVisualizer.setRadiusMultiplier(1.2f);

// set the line with for the visualizer between 1-10 default 1.
circleVisualizer.setStrokeWidth(1);

// Set you media player to the visualizer. 
circleVisualizer.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