项目作者: SuperKogito

项目描述 :
:mega: Python library for audio augmentation
高级语言: Python
项目地址: git://github.com/SuperKogito/pydiogment.git
创建时间: 2019-12-09T10:34:32Z
项目社区:https://github.com/SuperKogito/pydiogment

开源协议:BSD 3-Clause "New" or "Revised" License

下载




:bell: Pydiogment

Build Status Build status Documentation Status License%20-blue) Python Coverage Status Coverage Status CodeFactor

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.

:inbox_tray: Installation

Dependencies

Pydiogment requires:

On Linux

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

On Windows you can use the following installation binaries:

On MacOS

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 Scipy pip 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

Installation

If you already have a working installation of NumPy and SciPy , you can simply install Pydiogment using pip:

  1. pip install pydiogment

To update an existing version of Pydiogment, use:

  1. pip install -U pydiogment

:bulb: How to use

    • Apply a fade in and fade out effect

      1. from pydiogment.auga import fade_in_and_out
      2. test_file = "path/test.wav"
      3. fade_in_and_out(test_file)
    • Apply gain to file

      1. from pydiogment.auga import apply_gain
      2. test_file = "path/test.wav"
      3. apply_gain(test_file, -100)
      4. apply_gain(test_file, -50)
    • Add Random Gaussian Noise based on SNR to file

      1. from pydiogment.auga import add_noise
      2. test_file = "path/test.wav"
      3. add_noise(test_file, 10)
    • Change file tone

      1. from pydiogment.augf import change_tone
      2. test_file = "path/test.wav"
      3. change_tone(test_file, 0.9)
      4. change_tone(test_file, 1.1)
    • Slow-down/ speed-up file

      1. from pydiogment.augt import slowdown, speed
      2. test_file = "path/test.wav"
      3. slowdown(test_file, 0.8)
      4. speed(test_file, 1.2)
    • Apply random cropping to the file

      1. from pydiogment.augt import random_cropping
      2. test_file = "path/test.wav"
      3. random_cropping(test_file, 1)
    • Change shift data on the time axis in a certain direction

      1. from pydiogment.augt import shift_time
      2. test_file = "path/test.wav"
      3. shift_time(test_file, 1, "right")
      4. shift_time(test_file, 1, "left")
  • Audio files format

    This library currently supports mono WAV files only.

:bookmark_tabs: Documentation

A thorough documentation of the library is available under pydiogment.readthedocs.io.

:construction_worker: Contributing and bugs report

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.

:tada: Acknowledgment and credits