paddlespeech.s2t.frontend.augmentor.resample module
Contain the resample augmentation model.
- class paddlespeech.s2t.frontend.augmentor.resample.ResampleAugmentor(rng, new_sample_rate)[source]
Bases:
AugmentorBase
Augmentation model for resampling.
See more info here: https://ccrma.stanford.edu/~jos/resample/index.html
- Parameters:
rng (random.Random) -- Random generator object.
new_sample_rate (int) -- New sample rate in Hz.
Methods
__call__
(x[, uttid, train])Call self as a function.
transform_audio
(audio_segment)Resamples the input audio to a target sample rate.
transform_feature
(spec_segment)Adds various effects to the input audo feature segment.
- transform_audio(audio_segment)[source]
Resamples the input audio to a target sample rate.
Note that this is an in-place transformation.
- Parameters:
audio (AudioSegment|SpeechSegment) -- Audio segment to add effects to.