pydiogment.augt#
Description: time based augmentation techniques/manipulations for audio data.
- pydiogment.augt.eliminate_silence(infile)[source]#
Eliminate silence from voice file using ffmpeg library.
- Parameters
infile (str) – Path to get the original voice file from.
- Returns
list including True for successful authentication, False otherwise and a percentage value representing the certainty of the decision.
- pydiogment.augt.random_cropping(infile, min_len=1)[source]#
Crop the infile with an input minimum duration.
- pydiogment.augt.resample_audio(infile, sr)[source]#
Resample the signal according a new input sampling rate with respect to the Nyquist-Shannon theorem.
- pydiogment.augt.reverse(infile)[source]#
Inverses the input signal to play from the end to the beginning and writes it to an output file
- Parameters
infile (str) – Input filename.
- pydiogment.augt.shift_time(infile, tshift, direction)[source]#
Augment audio data by shifting the time in the file. Signal can be shifted to the left or right.
Note
Time shifting is simply moving the audio to left/right with a random second. If shifting audio to left (fast forward) with x seconds, first x seconds will mark as 0 (i.e. silence). If shifting audio to right (back forward) with x seconds, last x seconds will mark as 0 (i.e. silence).