pull/768/head
Hui Zhang 3 years ago
parent c81743403a
commit a3e86dd8b5

@ -34,6 +34,7 @@ class ImpulseResponseAugmentor(AugmentorBase):
if not train:
return
self.transform_audio(x)
return x
def transform_audio(self, audio_segment):
"""Add impulse response effect.

@ -40,6 +40,7 @@ class NoisePerturbAugmentor(AugmentorBase):
if not train:
return
self.transform_audio(x)
return x
def transform_audio(self, audio_segment):
"""Add background noise audio.

@ -48,6 +48,7 @@ class OnlineBayesianNormalizationAugmentor(AugmentorBase):
if not train:
return
self.transform_audio(x)
return x
def transform_audio(self, audio_segment):
"""Normalizes the input audio using the online Bayesian approach.

@ -35,6 +35,7 @@ class ResampleAugmentor(AugmentorBase):
if not train:
return
self.transform_audio(x)
return x
def transform_audio(self, audio_segment):
"""Resamples the input audio to a target sample rate.

@ -35,6 +35,7 @@ class ShiftPerturbAugmentor(AugmentorBase):
if not train:
return
self.transform_audio(x)
return x
def transform_audio(self, audio_segment):
"""Shift audio.

@ -163,7 +163,7 @@ class SpecAugmentor(AugmentorBase):
def __call__(self, x, train=True):
if not train:
return
self.transform_feature(x)
return self.transform_feature(x)
def transform_feature(self, xs: np.ndarray):
"""

@ -83,6 +83,7 @@ class SpeedPerturbAugmentor(AugmentorBase):
if not train:
return
self.transform_audio(x)
return x
def transform_audio(self, audio_segment):
"""Sample a new speed rate from the given range and

@ -41,6 +41,7 @@ class VolumePerturbAugmentor(AugmentorBase):
if not train:
return
self.transform_audio(x)
return x
def transform_audio(self, audio_segment):
"""Change audio loadness.

Loading…
Cancel
Save