Skip to content

VolumeInterface

classe · Source

An interface class for volume transformation.

Extends: EventEmitter

Properties

volumeEditable

readonly

volumeEditable: boolean

Whether or not the volume of this stream is editable Source

volume

readonly

volume: number

The current volume of the stream Source

volumeDecibels

readonly

volumeDecibels: number

The current volume of the stream in decibels Source

volumeLogarithmic

readonly

volumeLogarithmic: number

The current volume of the stream from a logarithmic scale Source

Methods

setVolume

setVolume(volume: number)

Sets the volume relative to the input stream - i.e. 1 is normal, 0.5 is half, 2 is double. Parameters

NameTypeDescription
volumenumberThe volume that you want to set
Source

setVolumeDecibels

setVolumeDecibels(db: number)

Sets the volume in decibels. Parameters

NameTypeDescription
dbnumberThe decibels
Source

setVolumeLogarithmic

setVolumeLogarithmic(value: number)

Sets the volume so that a perceived value of 0.5 is half the perceived volume etc. Parameters

NameTypeDescription
valuenumberThe value for the volume
Source

Events

volumeChange

volumeChange: unknown

Emitted when the volume of this interface changes. Parameters

NameTypeDescription
oldVolumenumberThe old volume of this interface
newVolumenumberThe new volume of this interface
Source

Unofficial software. Not affiliated with or supported by Discord.