1 | import { Hertz, NormalRange, PowerOfTwo } from "../../core/type/Units.js";
|
2 | import { MeterBase, MeterBaseOptions } from "./MeterBase.js";
|
3 | export interface FFTOptions extends MeterBaseOptions {
|
4 | size: PowerOfTwo;
|
5 | smoothing: NormalRange;
|
6 | normalRange: boolean;
|
7 | }
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export declare class FFT extends MeterBase<FFTOptions> {
|
14 | readonly name: string;
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 | normalRange: boolean;
|
21 | |
22 |
|
23 |
|
24 | constructor(size?: PowerOfTwo);
|
25 | constructor(options?: Partial<FFTOptions>);
|
26 | static getDefaults(): FFTOptions;
|
27 | /**
|
28 | * Gets the current frequency data from the connected audio source.
|
29 | * Returns the frequency data of length {@link size} as a Float32Array of decibel values.
|
30 | */
|
31 | getValue(): Float32Array;
|
32 | /**
|
33 | * The size of analysis. This must be a power of two in the range 16 to 16384.
|
34 | * Determines the size of the array returned by {@link getValue} (i.e. the number of
|
35 | * frequency bins). Large FFT sizes may be costly to compute.
|
36 | */
|
37 | get size(): PowerOfTwo;
|
38 | set size(size: PowerOfTwo);
|
39 | |
40 |
|
41 |
|
42 | get smoothing(): NormalRange;
|
43 | set smoothing(val: NormalRange);
|
44 | |
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | getFrequencyOfIndex(index: number): Hertz;
|
51 | }
|