Code example for Visualizer

Methods: setCaptureSize, setDataCaptureListener, setEnabled

0
	  } 
	  mPlayer.start();*/ 
	  //setup your Vizualizer - call method 
	  //setupVisualizerFxAndUI();         
	  setupVisualizer(audioSessionId);
	  mVisualizer.setEnabled(true);
	} 
 
	public void setupVisualizer(int audioSessionId) {
	  // Create the Visualizer object and attach it to our media player. 
	  //YOU NEED android.permission.RECORD_AUDIO for that in AndroidManifest.xml 
	  //steal the audio out 
	  mVisualizer = new Visualizer(audioSessionId);
	  NoiseSuppressor.create(audioSessionId);
	  //steal the file playback... not too exciting. 
	  //mVisualizer = new Visualizer(mPlayer.getAudioSessionId()); 
	  mVisualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1]);
	  mVisualizer.setDataCaptureListener(new Visualizer.OnDataCaptureListener() {
	      public void onWaveFormDataCapture(Visualizer visualizer, byte[] bytes,
		      int samplingRate) {
		  //mVisualizerView.updateVisualizer(bytes); 
	      }