UNPKG

1.34 kBTypeScriptView Raw
1import { Param } from "../core/context/Param.js";
2import { Seconds, Time, UnitMap, UnitName } from "../core/type/Units.js";
3import { OneShotSource, OneShotSourceOptions } from "../source/OneShotSource.js";
4export interface ToneConstantSourceOptions<TypeName extends UnitName> extends OneShotSourceOptions {
5 convert: boolean;
6 offset: UnitMap[TypeName];
7 units: TypeName;
8 minValue?: number;
9 maxValue?: number;
10}
11/**
12 * Wrapper around the native fire-and-forget ConstantSource.
13 * Adds the ability to reschedule the stop method.
14 * @category Signal
15 */
16export declare class ToneConstantSource<TypeName extends UnitName = "number"> extends OneShotSource<ToneConstantSourceOptions<TypeName>> {
17 readonly name: string;
18 /**
19 * The signal generator
20 */
21 private _source;
22 /**
23 * The offset of the signal generator
24 */
25 readonly offset: Param<TypeName>;
26 /**
27 * @param offset The offset value
28 */
29 constructor(offset: UnitMap[TypeName]);
30 constructor(options?: Partial<ToneConstantSourceOptions<TypeName>>);
31 static getDefaults(): ToneConstantSourceOptions<any>;
32 /**
33 * Start the source node at the given time
34 * @param time When to start the source
35 */
36 start(time?: Time): this;
37 protected _stopSource(time?: Seconds): void;
38 dispose(): this;
39}