audiblelight.augmentation.Gain

audiblelight.augmentation.Gain#

class audiblelight.augmentation.Gain(sample_rate=44100, gain_db=None)#

Bases: EventAugmentation

Applies gain (volume) to the audio.

A gain plugin that increases or decreases the volume of a signal by amplifying or attenuating it by the provided value (in decibels). No distortion or other effects are applied.

Parameters:
  • sample_rate (custom_types.Numeric) – the sample rate for the effect to use.

  • gain_db (int | float | complex | integer | floating | DistributionLike | None) – the gain to apply to the signal. By default, sampled between -10 and 10 dB.

__init__(sample_rate=44100, gain_db=None)#
Parameters:
  • sample_rate (int | float | complex | integer | floating)

  • gain_db (int | float | complex | integer | floating | DistributionLike | None)

Methods

__init__([sample_rate, gain_db])

from_dict(input_dict)

Initialise an augmentation from a dictionary.

process(input_array)

Calls the underlying FX (or a list of FX)

sample_value(override, default_dist)

Samples a value according to the following method:

to_dict()

Returns the parameters used by this augmentation

Attributes

AUGMENTATION_TYPE

MAX_GAIN

MIN_GAIN

name

Returns the name of this augmentation

MAX_GAIN = 10#
MIN_GAIN = -10#