Code example for Visualizer

Methods: setCaptureSize, setDataCaptureListener, setEnabled

0
    	    stopPlaying(); 
    	    return; 
    	} 
 
    	// Create the Visualizer object and attach it to our media player. 
    	mVisualizer = new Visualizer(player.getAudioSessionId());
    	mVisualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1]);
    	mVisualizer.setDataCaptureListener(new Visualizer.OnDataCaptureListener() {
    		public void onWaveFormDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {
//    			updateMouthOpenSize(bytes); 
        	} 
 
    		public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {
    			updateMouthOpenSize(bytes);
			} 
		}, Visualizer.getMaxCaptureRate() / 2, false, true);
    	mVisualizer.setEnabled(true);
    	 
	    player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
	    	public void onCompletion(MediaPlayer mediaPlayer) {
	    		stopPlaying(); 
	    		startRecording();