Skip to content
Tone.js

Waveform

class Component ↳ extends MeterBase<WaveformOptions>

Get the current waveform data of the connected audio source.

new Waveform(size?: number)

Parameters

  • size number optional

    The size of the Waveform. Value must be a power of two in the range 16 to 16384.

new Waveform(options?: Partial<WaveformOptions>)

Parameters

↳ inherited from MeterBase

input: InputNode

The signal to be analysed

read-only

name: string

The name of the class

Default: "Waveform"

↳ inherited from MeterBase

output: OutputNode

The output is just a pass through of the input

size: number

The size of analysis. This must be a power of two in the range 16 to 16384. Determines the size of the array returned by getValue.

↳ inherited from MeterBase

dispose(): this

Dispose and disconnect

Returns this

getValue(): Float32Array

Return the waveform for the current time as a Float32Array where each value in the array represents a sample in the waveform.

Returns Float32Array

static

getDefaults(): WaveformOptions

Returns all of the default options belonging to the class.

Returns WaveformOptions