Skip to content
Tone.js

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();
new Volume(volume?: number)

Parameters

  • volume number optional

    the initial volume in decibels

new Volume(options?: Partial<VolumeOptions>)

Parameters

input: Gain<"decibels">

Input and output are the same

read-only

name: string

The name of the class

Default: "Volume"

output: Gain<"decibels">

the output node

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: boolean

Mute the output.

const vol = new Tone.Volume(-12).toDestination();
const osc = new Tone.Oscillator().connect(vol).start();
// mute the output
vol.mute = true;
dispose(): this

clean up

Returns this

static

getDefaults(): VolumeOptions

Returns all of the default options belonging to the class.

Returns VolumeOptions