1 | import { Positive, Time } from "../core/type/Units.js";
|
2 | import { Source, SourceOptions } from "../source/Source.js";
|
3 | export type NoiseType = "white" | "brown" | "pink";
|
4 | export interface NoiseOptions extends SourceOptions {
|
5 | type: NoiseType;
|
6 | playbackRate: Positive;
|
7 | fadeIn: Time;
|
8 | fadeOut: Time;
|
9 | }
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export declare class Noise extends Source<NoiseOptions> {
|
31 | readonly name: string;
|
32 | |
33 |
|
34 |
|
35 | private _source;
|
36 | |
37 |
|
38 |
|
39 | private _type;
|
40 | |
41 |
|
42 |
|
43 |
|
44 | private _playbackRate;
|
45 | |
46 |
|
47 |
|
48 | protected _fadeIn: Time;
|
49 | |
50 |
|
51 |
|
52 | protected _fadeOut: Time;
|
53 | |
54 |
|
55 |
|
56 | constructor(type?: NoiseType);
|
57 | constructor(options?: Partial<NoiseOptions>);
|
58 | static getDefaults(): NoiseOptions;
|
59 | /**
|
60 | * The type of the noise. Can be "white", "brown", or "pink".
|
61 | * @example
|
62 | * const noise = new Tone.Noise().toDestination().start();
|
63 | * noise.type = "brown";
|
64 | */
|
65 | get type(): NoiseType;
|
66 | set type(type: NoiseType);
|
67 | /**
|
68 | * The playback rate of the noise. Affects
|
69 | * the "frequency" of the noise.
|
70 | */
|
71 | get playbackRate(): Positive;
|
72 | set playbackRate(rate: Positive);
|
73 | /**
|
74 | * internal start method
|
75 | */
|
76 | protected _start(time?: Time): void;
|
77 | /**
|
78 | * internal stop method
|
79 | */
|
80 | protected _stop(time?: Time): void;
|
81 | /**
|
82 | * The fadeIn time of the amplitude envelope.
|
83 | */
|
84 | get fadeIn(): Time;
|
85 | set fadeIn(time: Time);
|
86 | /**
|
87 | * The fadeOut time of the amplitude envelope.
|
88 | */
|
89 | get fadeOut(): Time;
|
90 | set fadeOut(time: Time);
|
91 | protected _restart(time?: Time): void;
|
92 | /**
|
93 | * Clean up.
|
94 | */
|
95 | dispose(): this;
|
96 | }
|