1 | import { InputNode, OutputNode, ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode.js";
|
2 | import { NormalRange, PowerOfTwo } from "../../core/type/Units.js";
|
3 | export type AnalyserType = "fft" | "waveform";
|
4 | export interface AnalyserOptions extends ToneAudioNodeOptions {
|
5 | size: PowerOfTwo;
|
6 | type: AnalyserType;
|
7 | smoothing: NormalRange;
|
8 | channels: number;
|
9 | }
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare class Analyser extends ToneAudioNode<AnalyserOptions> {
|
16 | readonly name: string;
|
17 | readonly input: InputNode;
|
18 | readonly output: OutputNode;
|
19 | |
20 |
|
21 |
|
22 | private _analysers;
|
23 | |
24 |
|
25 |
|
26 | private _gain;
|
27 | |
28 |
|
29 |
|
30 | private _split;
|
31 | |
32 |
|
33 |
|
34 | private _type;
|
35 | |
36 |
|
37 |
|
38 | private _buffers;
|
39 | |
40 |
|
41 |
|
42 |
|
43 | constructor(type?: AnalyserType, size?: number);
|
44 | constructor(options?: Partial<AnalyserOptions>);
|
45 | static getDefaults(): AnalyserOptions;
|
46 | /**
|
47 | * Run the analysis given the current settings. If {@link channels} = 1,
|
48 | * it will return a Float32Array. If {@link channels} > 1, it will
|
49 | * return an array of Float32Arrays where each index in the array
|
50 | * represents the analysis done on a channel.
|
51 | */
|
52 | getValue(): Float32Array | Float32Array[];
|
53 | |
54 |
|
55 |
|
56 | get size(): PowerOfTwo;
|
57 | set size(size: PowerOfTwo);
|
58 | |
59 |
|
60 |
|
61 |
|
62 | get channels(): number;
|
63 | |
64 |
|
65 |
|
66 | get type(): AnalyserType;
|
67 | set type(type: AnalyserType);
|
68 | |
69 |
|
70 |
|
71 | get smoothing(): NormalRange;
|
72 | set smoothing(val: NormalRange);
|
73 | |
74 |
|
75 |
|
76 | dispose(): this;
|
77 | }
|