UNPKG

1.68 kBTypeScriptView Raw
1import { Gain } from "../../core/context/Gain.js";
2import { Param } from "../../core/context/Param.js";
3import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode.js";
4import { Decibels } from "../../core/type/Units.js";
5interface VolumeOptions extends ToneAudioNodeOptions {
6 volume: Decibels;
7 mute: boolean;
8}
9/**
10 * Volume is a simple volume node, useful for creating a volume fader.
11 *
12 * @example
13 * const vol = new Tone.Volume(-12).toDestination();
14 * const osc = new Tone.Oscillator().connect(vol).start();
15 * @category Component
16 */
17export declare class Volume extends ToneAudioNode<VolumeOptions> {
18 readonly name: string;
19 /**
20 * the output node
21 */
22 output: Gain<"decibels">;
23 /**
24 * Input and output are the same
25 */
26 input: Gain<"decibels">;
27 /**
28 * The unmuted volume
29 */
30 private _unmutedVolume;
31 /**
32 * The volume control in decibels.
33 * @example
34 * const vol = new Tone.Volume().toDestination();
35 * const osc = new Tone.Oscillator().connect(vol).start();
36 * vol.volume.value = -20;
37 */
38 volume: Param<"decibels">;
39 /**
40 * @param volume the initial volume in decibels
41 */
42 constructor(volume?: Decibels);
43 constructor(options?: Partial<VolumeOptions>);
44 static getDefaults(): VolumeOptions;
45 /**
46 * Mute the output.
47 * @example
48 * const vol = new Tone.Volume(-12).toDestination();
49 * const osc = new Tone.Oscillator().connect(vol).start();
50 * // mute the output
51 * vol.mute = true;
52 */
53 get mute(): boolean;
54 set mute(mute: boolean);
55 /**
56 * clean up
57 */
58 dispose(): this;
59}
60export {};