Skip to content

Module: src/visualizer/frequency/VisualizerFrequencyRender

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
Author
Frank Kudermann - alphanull
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.

Parameters:
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.

Parameters:
Name Type Description
hiPass number

The high-pass filter value (0-1).

loPass number

The low-pass filter value (0-1).

Source
VisualizerFrequencyRender.js, line 19