Skip to main content

Python audio augmentation

Project description

:bell: pydiogment

Build Status Documentation Status License Python Coverage Status Coverage Status

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 -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, coefficient=0.8)
      speed(test_file, coefficient=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.2.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydiogment-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e1ae91ab471ffd5ea7f5bdadefb8a5ac2a996ee15bd8628357118c4ad19b3e67
MD5 0ee3589abe7a022d4d1bd8c5eab6bc69
BLAKE2b-256 841af7194247fe45b7e625b89c25d44842db098d7391f9bdf27ee121efc36622

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pydiogment-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7dd8a6f5b88f6581a933ae83a4b921baeedfa6e5a3ed2b5649612937594cb8f9
MD5 ff5bf2baa75b7732f88993dc9a0ed2b8
BLAKE2b-256 3a6c738ef9c16bb16f736622603d20503ce9f9aeff929bd87658c6a2999021fa

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