Giter Site home page Giter Site logo

superkogito / pydiogment Goto Github PK

View Code? Open in Web Editor NEW
85.0 9.0 16.0 90.81 MB

:mega: Python library for audio augmentation

Home Page: https://superkogito.github.io/pydiogment/

License: BSD 3-Clause "New" or "Revised" License

Python 81.42% TeX 15.77% Makefile 2.82%
audio augmentation audio-processing sound sound-processing audio-effects machine-learning deep-learning python

pydiogment's Introduction

๐Ÿ”” Pydiogment

Build Status Build status Documentation Status License 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.

๐Ÿ“ฅ 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:

pip install pydiogment

To update an existing version of Pydiogment, use:

pip install -U pydiogment

๐Ÿ’ก How to use

  • Amplitude related augmentation

    • Apply a fade in and fade out effect

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

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

      from pydiogment.auga import add_noise
      
      test_file = "path/test.wav"
      add_noise(test_file, 10)
  • Frequency related augmentation

    • Change file tone

      from pydiogment.augf import change_tone
      
      test_file = "path/test.wav"
      change_tone(test_file, 0.9)
      change_tone(test_file, 1.1)
  • Time related augmentation

    • Slow-down/ speed-up file

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

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

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

This library currently supports mono WAV files only.

๐Ÿ“‘ Documentation

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

๐Ÿ‘ท 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.

๐ŸŽ‰ Acknowledgment and credits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.