Skip to content

Commit

Permalink
modify setup.sh to delete the install of libsamplerate
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisxu2016 committed Jun 21, 2017
1 parent 2fabda8 commit 75ea374
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions deep_speech_2/data_utils/augmentor/speed_perturb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ class SpeedPerturbAugmentor(AugmentorBase):
def __init__(self, rng, min_speed_rate, max_speed_rate):

if (min_speed_rate < 0.5):
raise ValueError("Sampling speed below 0.9 can cause unnatural effects")
raise ValueError("Sampling speed below 0.9 can cause unnatural "\
"effects")
if (max_speed_rate > 1.5):
raise ValueError("Sampling speed above 1.1 can cause unnatural effects")
raise ValueError("Sampling speed above 1.1 can cause unnatural "\
"effects")
self._min_speed_rate = min_speed_rate
self._max_speed_rate = max_speed_rate
self._rng = rng
Expand All @@ -39,5 +41,6 @@ def transform_audio(self, audio_segment):
:param audio_segment: Audio segment to add effects to.
:type audio_segment: AudioSegment|SpeechSegment
"""
sampled_speed = self._rng.uniform(self._min_speed_rate, self._max_speed_rate)
sampled_speed = self._rng.uniform(self._min_speed_rate,
self._max_speed_rate)
audio_segment.change_speed(sampled_speed)

0 comments on commit 75ea374

Please sign in to comment.