audiblelight.augmentation.MP3Compressor#

class audiblelight.augmentation.MP3Compressor(sample_rate=44100, vbr_quality=None)#

Bases: EventAugmentation

Applies the LAME MP3 encoder in real-time to add compression artifacts to the audio stream.

Currently only supports variable bit-rate mode (VBR) and accepts a floating-point VBR quality value (between 0.0 and 10.0; lower is better). Note that the MP3 format only supports 8kHz, 11025Hz, 12kHz, 16kHz, 22050Hz, 24kHz, 32kHz, 44.1kHz, and 48kHz audio; if an unsupported sample rate is provided, an exception will be thrown at processing time.

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

  • vbr_quality (int | float | complex | integer | floating | DistributionLike | None) – the quality of the resampling. By default, will be sampled between 2 and 10.

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

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

Methods

__init__([sample_rate, vbr_quality])

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

SUPPORTED_SAMPLE_RATES

VBR_MAX

VBR_MIN

name

Returns the name of this augmentation

SUPPORTED_SAMPLE_RATES = [8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000]#
VBR_MAX = 9.999#
VBR_MIN = 2.001#