paddlespeech.s2t.frontend.augmentor.noise_perturb module
Contains the noise perturb augmentation model.
- class paddlespeech.s2t.frontend.augmentor.noise_perturb.NoisePerturbAugmentor(rng, min_snr_dB, max_snr_dB, noise_manifest_path)[source]
Bases:
AugmentorBase
Augmentation model for adding background noise.
- Parameters:
rng (random.Random) -- Random generator object.
min_snr_dB (float) -- Minimal signal noise ratio, in decibels.
max_snr_dB (float) -- Maximal signal noise ratio, in decibels.
noise_manifest_path (str) -- Manifest path for noise audio data.
Methods
__call__
(x[, uttid, train])Call self as a function.
transform_audio
(audio_segment)Add background noise audio.
transform_feature
(spec_segment)Adds various effects to the input audo feature segment.
- transform_audio(audio_segment)[source]
Add background noise audio.
Note that this is an in-place transformation.
- Parameters:
audio_segment (AudioSegmenet|SpeechSegment) -- Audio segment to add effects to.