data_juicer.ops.mapper.audio_add_gaussian_noise_mapper module

class data_juicer.ops.mapper.audio_add_gaussian_noise_mapper.AudioAddGaussianNoiseMapper(min_amplitude: float = 0.001, max_amplitude: float = 0.015, p: float = 0.5, save_dir: str = None, *args, **kwargs)[源代码]

基类:Mapper

Mapper to add gaussian noise to audio.

__init__(min_amplitude: float = 0.001, max_amplitude: float = 0.015, p: float = 0.5, save_dir: str = None, *args, **kwargs)[源代码]

Initialization method.

参数:
  • min_amplitude -- float unit: linear amplitude. Default: 0.001. Minimum noise amplification factor.

  • max_amplitude -- float unit: linear amplitude. Default: 0.015. Maximum noise amplification factor.

  • p -- float range: [0.0, 1.0]. Default: 0.5. The probability of applying this transform.

save_dir: str. Default: None.

The directory where generated audio files will be stored. If not specified, outputs will be saved in the same directory as their corresponding input files. This path can alternatively be defined by setting the DJ_PRODUCED_DATA_DIR environment variable.

process_single(sample, context=False)[源代码]

For sample level, sample --> sample

参数:

sample -- sample to process

返回:

processed sample