1 | import { Param } from "../../core/context/Param.js";
|
2 | import { Cents, Frequency, Seconds, Time } from "../../core/type/Units.js";
|
3 | import { OneShotSource, OneShotSourceOptions } from "../OneShotSource.js";
|
4 | export interface ToneOscillatorNodeOptions extends OneShotSourceOptions {
|
5 | frequency: Frequency;
|
6 | detune: Cents;
|
7 | type: OscillatorType;
|
8 | }
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare class ToneOscillatorNode extends OneShotSource<ToneOscillatorNodeOptions> {
|
16 | readonly name: string;
|
17 | |
18 |
|
19 |
|
20 | private _oscillator;
|
21 | protected _internalChannels: OscillatorNode[];
|
22 | |
23 |
|
24 |
|
25 | readonly frequency: Param<"frequency">;
|
26 | |
27 |
|
28 |
|
29 | readonly detune: Param<"cents">;
|
30 | |
31 |
|
32 |
|
33 |
|
34 | constructor(frequency: Frequency, type: OscillatorType);
|
35 | constructor(options?: Partial<ToneOscillatorNodeOptions>);
|
36 | static getDefaults(): ToneOscillatorNodeOptions;
|
37 | /**
|
38 | * Start the oscillator node at the given time
|
39 | * @param time When to start the oscillator
|
40 | */
|
41 | start(time?: Time): this;
|
42 | protected _stopSource(time?: Seconds): void;
|
43 | /**
|
44 | * Sets an arbitrary custom periodic waveform given a PeriodicWave.
|
45 | * @param periodicWave PeriodicWave should be created with context.createPeriodicWave
|
46 | */
|
47 | setPeriodicWave(periodicWave: PeriodicWave): this;
|
48 | /**
|
49 | * The oscillator type. Either 'sine', 'sawtooth', 'square', or 'triangle'
|
50 | */
|
51 | get type(): OscillatorType;
|
52 | set type(type: OscillatorType);
|
53 | /**
|
54 | * Clean up.
|
55 | */
|
56 | dispose(): this;
|
57 | }
|