VolumeInterface
classe · Source
An interface class for volume transformation.
Extends: EventEmitter
Properties
volumeEditable
volumeEditable: boolean
Whether or not the volume of this stream is editable Source
volume
volume: number
The current volume of the stream Source
volumeDecibels
volumeDecibels: number
The current volume of the stream in decibels Source
volumeLogarithmic
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
| Name | Type | Description |
|---|---|---|
volume | number | The volume that you want to set |
| Source |
setVolumeDecibels
setVolumeDecibels(db: number)
Sets the volume in decibels. Parameters
| Name | Type | Description |
|---|---|---|
db | number | The decibels |
| Source |
setVolumeLogarithmic
setVolumeLogarithmic(value: number)
Sets the volume so that a perceived value of 0.5 is half the perceived volume etc. Parameters
| Name | Type | Description |
|---|---|---|
value | number | The value for the volume |
| Source |
Events
volumeChange
volumeChange: unknown
Emitted when the volume of this interface changes. Parameters
| Name | Type | Description |
|---|---|---|
oldVolume | number | The old volume of this interface |
newVolume | number | The new volume of this interface |
| Source |