Class VisualizerAbstract

This private class is superclass for visualizer class (TimeOverview, Time, FFT).

Hierarchy (view full)

Implements

Constructors

Properties

canvas: null | HTMLCanvasElement = null
channel: ChannelNumber
context: null | CanvasRenderingContext2D = null
graphics: GraphicsApi = ''
interval: number = 1000
isActive: boolean = false
sampleRate: number
styles: GraphicsStyles = ...
svg: null | SVGSVGElement = null
SVG_LINEAR_GRADIENT_ID_FFT: string = 'svg-linear-gradient-fft'
SVG_LINEAR_GRADIENT_ID_TIME: string = 'svg-linear-gradient-time'
SVG_LINEAR_GRADIENT_ID_TIME_OVERVIEW: string = 'svg-linear-gradient-time-overview'
XLINK: "http://www.w3.org/1999/xlink" = ...
XMLNS: "http://www.w3.org/2000/svg" = ...

Methods

  • This method creates elements for SVG linear gradient.

    Parameters

    • linearGradientId: string

      This argument is id attribute for SVGLinearGradientElement.

    Returns null | SVGDefsElement

    This value is as instance of SVGDefsElement.

  • This method gets instance of HTMLCanvasElement or SVGSVGElement.

    Returns null | HTMLCanvasElement | SVGSVGElement

  • This method visualizes sound wave to Canvas or SVG. This method conceals difference of API for visualization.

    Parameters

    • data: Float32Array | Uint8Array

      This argument is sound data for visualization.

    • OptionalminDecibels: number

      This argument is parameter for spectrum. The default value is -100 dB.

    • OptionalmaxDecibels: number

      This argument is parameter for spectrum. The default value is -30 dB.

    Returns Visualizer

    Return value is for method chain.

  • Parameters

    • data: Float32Array | Uint8Array
    • OptionalminDecibels: number
    • OptionalmaxDecibels: number

    Returns void

  • Parameters

    • data: Float32Array | Uint8Array
    • OptionalminDecibels: number
    • OptionalmaxDecibels: number

    Returns void

  • This method visualizes time domain data (Float32Array) to SVG.

    Parameters

    • data: Float32Array

      This argument is time domain data.

    • innerWidth: number

      This argument is width of visualization area.

    • innerHeight: number

      This argument is height of visualization area.

    • middle: number

      This argument is middle of visualization area.

    • numberOfPlots: number

      This argument is interval for visualization.

    • linearGradientId: string

      This argument is id attribute for SVGLinearGradientElement.

    Returns null | SVGPathElement | SVGGElement

    This value is instance of SVGPathElement or SVGGElement.

  • This method visualizes time domain data (Float32Array) to Canvas.

    Parameters

    • context: CanvasRenderingContext2D

      This argument is instance of CanvasRenderingContext2D.

    • data: Float32Array

      This argument is time domain data.

    • innerWidth: number

      This argument is width of visualization area.

    • innerHeight: number

      This argument is height of visualization area.

    • middle: number

      This argument is middle of visualization area.

    • OptionalnumberOfPlots: number

      This argument is interval for visualization.

    Returns void