Pydiogment aims to simplify audio augmentation. It generates multiple audio files based on a starting mono audio file. The library can generates files with higher speed, slower, and different tones etc.
Pydiogment requires:
On Linux you can use the following commands to get the libraries:
- Numpy:
pip install numpy
- Scipy:
pip install scipy
- FFmpeg:
sudo apt install ffmpeg
On Windows you can use the following installation binaries:
- Numpy: https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy or if you have Python already installed you can use install it using
pip3 install numpy
- Scipy: https://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
- FFmpeg: https://ffmpeg.org/download.html#build-windows
On MacOs, use homebrew to install the packages:
- Numpy:
brew install numpy --with-python3
- Scipy: You need to first install a compilation tool like Gfortran using homebrew
brew install gfortran
when it's done, install Scipypip install scipy
for more information and guidelines you can check this link: https://github.com/scipy/scipy/blob/master/INSTALL.rst.txt#mac-os-x - FFmpeg:
brew install ffmpeg
If you already have a working installation of NumPy and SciPy , you can simply install Pydiogment using pip:
pip install pydiogment
To update an existing version of Pydiogment, use:
pip install -U pydiogment
-
-
from pydiogment.auga import fade_in_and_out test_file = "path/test.wav" fade_in_and_out(test_file)
-
from pydiogment.auga import apply_gain test_file = "path/test.wav" apply_gain(test_file, -100) apply_gain(test_file, -50)
-
from pydiogment.auga import add_noise test_file = "path/test.wav" add_noise(test_file, 10)
-
-
-
from pydiogment.augf import change_tone test_file = "path/test.wav" change_tone(test_file, 0.9) change_tone(test_file, 1.1)
-
-
-
from pydiogment.augt import slowdown, speed test_file = "path/test.wav" slowdown(test_file, 0.8) speed(test_file, 1.2)
-
from pydiogment.augt import random_cropping test_file = "path/test.wav" random_cropping(test_file, 1)
-
from pydiogment.augt import shift_time test_file = "path/test.wav" shift_time(test_file, 1, "right") shift_time(test_file, 1, "left")
-
This library currently supports mono WAV files only.
A thorough documentation of the library is available under pydiogment.readthedocs.io.
Contributions are welcome and encouraged. To learn more about how to contribute to Pydiogment please refer to the Contributing guidelines
To report bugs, request a feature or just ask for help you can refer to the issues section. Before reporting a bug please make sure it is not addressed by an older issue and make sure to add your operating system type, its version number and the versions of the dependencies used.
- The test file used in the pytests is OSR_us_000_0060_8k.wav from the Open Speech Repository.