Need help with droid-vizu?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

wotomas
204 Stars 31 Forks Apache License 2.0 41 Commits 2 Opened issues

Description

Droid-vizu aims to provide customized visualization effects by easily swapping Renderer to get cool effects

Services available

!
?

Need anything else?

Contributors list

Droid-vizu

API Download

About

Droid-vizu aims to provide cool visualization effects for any Android audio project. Maintainable modular design allows users to easily swap Renderer class to get corresponding effects.

Demo (click for audio)

Implement

repositories {
  jcenter()
}

dependencies { compile 'info.kimjihyok:droid-vizu:${droid-vizu}' }

XML Setup

    
    

<!-- Sample Player -->
<info.kimjihyok.ripplesoundplayer.soundplayerview android:id="@+id/sound_player_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true"></info.kimjihyok.ripplesoundplayer.soundplayerview>    

Code Usage

Simply Provide RippleVisualizerViw with an prepared Android MediaPlayer and set with a corresponding renderer

    MediaPlayer mediaPlayer = MediaPlayer.create(getApplicationContext(), R.raw.sound_file);  // or any other way to initialize media player are prepare()
    soundPlayerView = (SoundPlayerView) findViewById(R.id.sound_player_view);
    soundPlayerView.setMediaPlayer(mediaPlayer);
    soundPlayerView.setPlayStopListener(new SoundPlayerView.OnMediaControlListener() {
        @Override
        public void onPlay() {
          renderDemoView.play();
        }

    @Override
    public void onStop() {
      renderDemoView.stop();
    }
  });

renderDemoView = (RippleVisualizerView) findViewById(R.id.renderer_demo);
renderDemoView.setMediaPlayer(mediaPlayer);
renderDemoView.setCurrentRenderer(renderer);

Renderer Information

Detailed information about parameters could be found in the source code!

ColorBarRenderer

java
  renderDemoView.setCurrentRenderer(new ColorfulBarRenderer(8, PaintUtil.getBarGraphPaint(Color.BLUE)
            , Color.parseColor("#FF0033")
            , Color.parseColor("#801AB3"))

BarRenderer

java
  new BarRenderer(16, PaintUtil.getBarGraphPaint(Color.WHITE));

LineRenderer

java
  new LineRenderer(PaintUtil.getLinePaint(Color.YELLOW));

Stop and Destory

// It is required to stop at onStop and to destory at onDestory to prevent memory leak and unexpected events
@Override
protected void onStop() {
  super.onStop();
  soundPlayerView.onStop();
  renderDemoView.stop();
}

@Override protected void onDestroy() { super.onDestroy(); soundPlayerView.onDestroy(); renderDemoView.destroy(); }

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.