Code example for Visualizer

Methods: setCaptureSize

0
    } 
 
    public VisualizerController(Context context, MediaPlayer mediaPlayer) {
        this.context = context;
        try { 
            visualizer = new Visualizer(mediaPlayer.getAudioSessionId());
        } catch (Throwable x) {
            Log.w(TAG, "Failed to create visualizer.", x);
        } 
 
        if (visualizer != null) {
            int[] captureSizeRange = Visualizer.getCaptureSizeRange();
            int captureSize = Math.max(PREFERRED_CAPTURE_SIZE, captureSizeRange[0]);
            captureSize = Math.min(captureSize, captureSizeRange[1]);
            visualizer.setCaptureSize(captureSize);
        } 
    } 
 
    public boolean isAvailable() { 
        return visualizer != null;
Contextual code suggestions in your IDE  Get Codota for Java