This module provides the render function for frequency-based audio visualization. It receives raw frequency data (typically from the Web Audio API) and draws a frequency spectrum on a given canvas element using logarithmic scaling and dynamic smoothing. The function is used by both the main thread and worker-based rendering logic in frequency visualizer components.
- Version
- 1.0.0
- License
- MIT
- Requires
- math
- Source
- VisualizerFrequencyRender.js, line 6
Methods
inner render(frequencyData, canvas, context, config)
Renders the frequency data onto the provided canvas using the specified context and configuration. This function is both being used by the worker / non-worker rendering path.
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
frequencyData |
Array<number> |
An array containing frequency data for left and right channels. |
|||||||||
canvas |
HTMLCanvasElement |
The canvas element where the visualization will be rendered. |
|||||||||
context |
CanvasRenderingContext2D |
The 2D rendering context for the canvas. |
|||||||||
config |
Object |
Additional render options.
|
- Source
- VisualizerFrequencyRender.js, line 19