Class AudioVisualizer
java.lang.Object
wiiuu.ui.AudioVisualizer
FFT spectrum analysis and ambient/fullscreen painting for host-provided normalized mono audio.
Supply samples at a fixed update cadence for smoothing; update and paint on the same UI thread.
Branding, track text and exit hints are supplied by the host. No playback or input is installed.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAudioVisualizer(double sampleRate) Audio in normalized mono samples; no audio device or playback is opened.AudioVisualizer(double sampleRate, LongSupplier clock) Supply a monotonic nanosecond clock for deterministic ring rotation. -
Method Summary
Modifier and TypeMethodDescriptionfloatbass()The bass, 0..1: jumps with each kick, then falls back.float[]levels()A snapshot of the bars, 0..1, low to high.voidpaintAmbient(Graphics2D g, int w, float baseY, float maxH, Color accent) The strip behind the tiles: translucent bars standing on the dock's edge.voidpaintFull(Graphics2D g0, int w, int h, String title, String subtitle, String label, String accentLabel, Color accent, String hint) Full screen: a dark stage, the spectrum ring around WII-UU's name, the waveform and the track.voidupdate(float[] mono, int end) Updates the bars frommono, the last 2048 samples before exclusive end, zero-padded when fewer are available.float[]wave()A snapshot of the waveform just supplied, normalized to about -1..1.
-
Field Details
-
SAMPLE_COUNT
public static final int SAMPLE_COUNT- See Also:
-
BANDS
public static final int BANDS- See Also:
-
-
Constructor Details
-
AudioVisualizer
public AudioVisualizer(double sampleRate) Audio in normalized mono samples; no audio device or playback is opened. -
AudioVisualizer
Supply a monotonic nanosecond clock for deterministic ring rotation.
-
-
Method Details
-
update
public void update(float[] mono, int end) Updates the bars frommono, the last 2048 samples before exclusive end, zero-padded when fewer are available. -
levels
public float[] levels()A snapshot of the bars, 0..1, low to high. -
bass
public float bass()The bass, 0..1: jumps with each kick, then falls back. -
wave
public float[] wave()A snapshot of the waveform just supplied, normalized to about -1..1. -
paintAmbient
The strip behind the tiles: translucent bars standing on the dock's edge. -
paintFull
-