Inherits juce::Component.
Visual component for displaying audio waveforms with zoom and scroll.
WaveformComponent renders multi-channel audio waveforms with support for horizontal zooming and panning. It efficiently displays large audio buffers by downsampling to min/max envelopes at the current zoom level, providing smooth visualization even for long audio files.
Key Features:
- Multi-channel waveform display
- Horizontal zoom and scroll
- Efficient downsampling for display
- Min/max envelope rendering
- Customizable colors via ColourIds
- Automatic updates on resize
- Optimized for real-time display
Color Customization:
- lineColourId: Color for zero-crossing line
- backgroundColourId: Background color
- traceColourId: Waveform trace color
- envelopeColourId: Waveform envelope fill color
The component automatically processes the audio buffer into min/max pairs for efficient rendering at any zoom level, avoiding the need to draw individual samples when zoomed out.
Usage:
waveform.setBounds(0, 0, 800, 200);
AudioBuffer<float> audioData(2, 44100);
Colours::lightblue.withAlpha(0.3f));
- See also
- juce::AudioSampleBuffer, juce::Component