Class: AudioVisualizer

AudioVisualizer(options) → {object|null}

new AudioVisualizer(options) → {object|null}

AudioVisualizer factory class to build all supported visualisation

This factory will return an AudioVisualizer component. It is automatically rendered, and will also be automatically linked to given audio source. No further manipulation are required (except destroy when done using) on runtime.

Each components have shared properties, and unique properties, as described in components class themselves. Refer to the components documentation for specific options.

Multi visualisation can have an impact on CPU load that mostly depends on client configuration. Keep that in mind if you develop your project with a battle station. When done using a component, please call its destroy method to remove listeners and audio processing to avoid memory leaks in your app.
Parameters:
Name Type Description
options object

The audio visualisation definition

Properties
Name Type Attributes Default Description
type string

The visualisation type, can be bars/circle/oscilloscope/peakmeter/spectrum/timeline/waveform

player object

A DOM audio player to be the audio source for processing

renderTo object

A DOM element to render the visualisation in. It will automatically scale content to this element's dimension

audioContext object <optional>
null

A WebAudioAPI audio context to chain the processing nodes in your audio routing.

inputNode object <optional>
null

The WebAudioAPI audio node to be the audio source for processing, You must provide an audioContext

fftSize number <optional>
1024

The FFT size to use in processing, must be a power of 2. High values cost more CPU

Since:
  • 2020
Author:
  • Arthur Beaulieu
Source:
Returns:
  • The custom visualisation component according to given options, null for unknown type
Type
object | null

Members

(static) version :string

The AudioVisualizer component version

Type:
  • string
Source: