paddlespeech.s2t.frontend.augmentor.shift_perturb module
Contains the volume perturb augmentation model.
- class paddlespeech.s2t.frontend.augmentor.shift_perturb.ShiftPerturbAugmentor(rng, min_shift_ms, max_shift_ms)[source]
Bases:
AugmentorBase
Augmentation model for adding random shift perturbation.
- Parameters:
rng (random.Random) -- Random generator object.
min_shift_ms (float) -- Minimal shift in milliseconds.
max_shift_ms (float) -- Maximal shift in milliseconds.
Methods
__call__
(x[, uttid, train])Call self as a function.
transform_audio
(audio_segment)Shift audio.
transform_feature
(spec_segment)Adds various effects to the input audo feature segment.
- transform_audio(audio_segment)[source]
Shift audio.
Note that this is an in-place transformation.
- Parameters:
audio_segment (AudioSegmenet|SpeechSegment) -- Audio segment to add effects to.