Skip to main content

Python audio augmentation

Project description

:bell: 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.

:inbox_tray: Installation

Dependencies

Pydiogment requires:

  • Python (>= 3.5)

  • NumPy (>= 1.17.2) pip install numpy

  • SciPy (>= 1.3.1) pip install scipy

  • FFmpeg sudo apt 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

:bulb: 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")
      

:bookmark_tabs: Documentation

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

:construction_worker: Contributing

Contributions are welcome and encouraged. To learn more about how to contribute to Pydiogment please refer to the Contributing guidelines

:tada: Acknowledgment and credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydiogment-0.0.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

pydiogment-0.0.3-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file pydiogment-0.0.3.tar.gz.

File metadata

  • Download URL: pydiogment-0.0.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for pydiogment-0.0.3.tar.gz
Algorithm Hash digest
SHA256 129d474df1496f3f6ac5c63679b6b4e8302887fecd98e7e51d31edd03efa211b
MD5 c212e0464776266eb917edcab4253a95
BLAKE2b-256 8b52842237990b67cc24a1e454149ee88c9dd4d4e531cdbd76bb7216f63361a2

See more details on using hashes here.

Provenance

File details

Details for the file pydiogment-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pydiogment-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for pydiogment-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1cad325e2121dd6957f1eca97febf38b5c48ac022d19ffc39155c170f4613967
MD5 6588eb81b7a106e6574aab0071394793
BLAKE2b-256 8ca5a43f0629d7e839bb10dc30f35e7876614c46a0cbe88320e9870cce1935d8

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page