def METHOD_NAME(self, audio_segment):
    """Sample a new speed rate from the given range and
    changes the speed of the given audio clip.
    Note that this is an in-place transformation.
    :param audio_segment: Audio segment to add effects to.
    :type audio_segment: AudioSegment|SpeechSegment
    """
    if self._num_rates < 0:
        speed_rate = self._rng.uniform(self._min_rate, self._max_rate)
    else:
        speed_rate = self._rng.choice(self._rates)
    # Skip perturbation in case of identity speed rate
    if speed_rate == 1.0:
        return
    audio_segment.change_speed(speed_rate)