Volume
class Component ↳ extends ToneAudioNode<VolumeOptions>
Volume is a simple volume node, useful for creating a volume fader.
const vol = new Tone.Volume(-12).toDestination(); const osc = new Tone.Oscillator().connect(vol).start();
Constructor
Section titled “Constructor”new Volume(volume?: number)Parameters
-
volume
numberoptionalthe initial volume in decibels
new Volume(options?: Partial<VolumeOptions>)Parameters
- options
Partial<VolumeOptions>optional
Properties
Section titled “Properties”volume
Section titled “volume”volume: Param<"decibels">The volume control in decibels.
const vol = new Tone.Volume().toDestination(); const osc = new Tone.Oscillator().connect(vol).start(); vol.volume.value = -20;
mute: booleanMute the output.
const vol = new Tone.Volume(-12).toDestination(); const osc = new Tone.Oscillator().connect(vol).start(); // mute the output vol.mute = true;
Methods
Section titled “Methods”getDefaults()
Section titled “getDefaults()”static
getDefaults(): VolumeOptionsReturns all of the default options belonging to the class.
Returns VolumeOptions
Inherited members
Section titled “Inherited members”- From
ToneWithContext: context, blockTime, sampleTime, get(), immediate(), now(), set(), toFrequency(), toSeconds(), toTicks() - From
Tone: debug, version, disposed, toString() - From
ToneAudioNode: channelCount, channelCountMode, channelInterpretation, numberOfInputs, numberOfOutputs, chain(), connect(), disconnect(), fan(), toDestination(), toMaster()