XSound - v4.1.3
    Preparing search index...

    Interface Time

    This private class visualizes sound wave in time domain.

    interface Time {
        canvas: null | HTMLCanvasElement;
        channel: ChannelNumber;
        context: null | CanvasRenderingContext2D;
        graphics: GraphicsApi;
        interval: number;
        isActive: boolean;
        sampleRate: number;
        styles: GraphicsStyles;
        svg: null | SVGSVGElement;
        activate(): Time;
        clear(): Time;
        create(
            mimeType?: string,
            params?: { callback: BlobCallback; quality?: number; type?: string },
        ): string | void;
        createFontString(): string;
        createSVGLinearGradient(linearGradientId: string): null | SVGDefsElement;
        deactivate(): Time;
        get(): null | HTMLCanvasElement | SVGSVGElement;
        param(params: "interval"): number;
        param(params: "styles"): GraphicsStyles;
        param(params: "type"): DataType;
        param(params: "textInterval"): number;
        param(params: TimeParams): Time;
        setup(element: HTMLCanvasElement | SVGSVGElement): Time;
        start(
            data: Float32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike>,
            minDecibels?: number,
            maxDecibels?: number,
        ): Time;
        state(): boolean;
        visualizeBySVG(
            data: Float32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike>,
            _minDecibels?: number,
            _maxDecibels?: number,
        ): void;
        visualizeOnCanvas(
            data: Float32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike>,
            _minDecibels?: number,
            _maxDecibels?: number,
        ): void;
        visualizeTimeDomainFloat32ArrayBySVG(
            data: Float32Array,
            innerWidth: number,
            innerHeight: number,
            middle: number,
            numberOfPlots: number,
            linearGradientId: string,
        ): null | SVGPathElement | SVGGElement;
        visualizeTimeDomainFloat32ArrayOnCanvas(
            context: CanvasRenderingContext2D,
            data: Float32Array,
            innerWidth: number,
            innerHeight: number,
            middle: number,
            numberOfPlots?: number,
        ): void;
    }

    Hierarchy (View Summary)

    Index

    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

    Methods

    • This method creates visualized graphics as string (Data URL or Blob or SVG).

      Parameters

      • OptionalmimeType: string

        This argument is string that indicates image format. The default value is image/octet-stream.

      • Optionalparams: { callback: BlobCallback; quality?: number; type?: string }

      Returns string | void

    • 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 or sets parameters for visualizing sound wave. This method is overloaded for type interface and type check.

      Parameters

      • params: "interval"

        This argument is string if getter. Otherwise, setter.

      Returns number

      Return value is parameter for visualizing sound wave if getter. Otherwise, return value is for method chain.

    • This method gets or sets parameters for visualizing sound wave. This method is overloaded for type interface and type check.

      Parameters

      • params: "styles"

        This argument is string if getter. Otherwise, setter.

      Returns GraphicsStyles

      Return value is parameter for visualizing sound wave if getter. Otherwise, return value is for method chain.

    • This method gets or sets parameters for visualizing sound wave. This method is overloaded for type interface and type check.

      Parameters

      • params: "type"

        This argument is string if getter. Otherwise, setter.

      Returns DataType

      Return value is parameter for visualizing sound wave if getter. Otherwise, return value is for method chain.

    • This method gets or sets parameters for visualizing sound wave. This method is overloaded for type interface and type check.

      Parameters

      • params: "textInterval"

        This argument is string if getter. Otherwise, setter.

      Returns number

      Return value is parameter for visualizing sound wave if getter. Otherwise, return value is for method chain.

    • This method gets or sets parameters for visualizing sound wave. This method is overloaded for type interface and type check.

      Parameters

      • params: TimeParams

        This argument is string if getter. Otherwise, setter.

      Returns Time

      Return value is parameter for visualizing sound wave if getter. Otherwise, return value is for method chain.

    • This method sets up for using Canvas or SVG.

      Parameters

      • element: HTMLCanvasElement | SVGSVGElement

        This argument is either HTMLCanvasElement or SVGSVGElement.

      Returns Time

      Return value is for method chain.

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

      Parameters

      • data: Float32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

        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 Time

      Return value is for method chain.

    • This method visualizes sound wave in time domain to SVG.

      Parameters

      • data: Float32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

        This argument is sound data for visualization.

      • Optional_minDecibels: number
      • Optional_maxDecibels: number

      Returns void

    • This method visualizes sound wave in time domain to Canvas.

      Parameters

      • data: Float32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

        This argument is sound data for visualization.

      • Optional_minDecibels: number
      • Optional_maxDecibels: 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