UNPKG

1.16 kBTypeScriptView Raw
1import { PowerOfTwo } from "../../core/type/Units.js";
2import { MeterBase, MeterBaseOptions } from "./MeterBase.js";
3export interface WaveformOptions extends MeterBaseOptions {
4 /**
5 * The size of the Waveform. Value must be a power of two in the range 16 to 16384.
6 */
7 size: PowerOfTwo;
8}
9/**
10 * Get the current waveform data of the connected audio source.
11 * @category Component
12 */
13export declare class Waveform extends MeterBase<WaveformOptions> {
14 readonly name: string;
15 /**
16 * @param size The size of the Waveform. Value must be a power of two in the range 16 to 16384.
17 */
18 constructor(size?: PowerOfTwo);
19 constructor(options?: Partial<WaveformOptions>);
20 static getDefaults(): WaveformOptions;
21 /**
22 * Return the waveform for the current time as a Float32Array where each value in the array
23 * represents a sample in the waveform.
24 */
25 getValue(): Float32Array;
26 /**
27 * The size of analysis. This must be a power of two in the range 16 to 16384.
28 * Determines the size of the array returned by {@link getValue}.
29 */
30 get size(): PowerOfTwo;
31 set size(size: PowerOfTwo);
32}