forked from PaddlePaddle/models
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
101,317 additions
and
1,045 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
group: deprecated-2017Q2 | ||
language: cpp | ||
cache: ccache | ||
sudo: required | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Contains the volume perturb augmentation model.""" | ||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
|
||
from data_utils.augmentor.base import AugmentorBase | ||
|
||
|
||
class ShiftPerturbAugmentor(AugmentorBase): | ||
"""Augmentation model for adding random shift perturbation. | ||
:param rng: Random generator object. | ||
:type rng: random.Random | ||
:param min_shift_ms: Minimal shift in milliseconds. | ||
:type min_shift_ms: float | ||
:param max_shift_ms: Maximal shift in milliseconds. | ||
:type max_shift_ms: float | ||
""" | ||
|
||
def __init__(self, rng, min_shift_ms, max_shift_ms): | ||
self._min_shift_ms = min_shift_ms | ||
self._max_shift_ms = max_shift_ms | ||
self._rng = rng | ||
|
||
def transform_audio(self, audio_segment): | ||
"""Shift audio. | ||
Note that this is an in-place transformation. | ||
:param audio_segment: Audio segment to add effects to. | ||
:type audio_segment: AudioSegmenet|SpeechSegment | ||
""" | ||
shift_ms = self._rng.uniform(self._min_shift_ms, self._max_shift_ms) | ||
audio_segment.shift(shift_ms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.