Code Monkey home page Code Monkey logo

augaudio's Introduction

augaudio

This package contains multiple simple audio data augmentations in order to increase/test the robustness of neural networks.

Original

Gaussian Noise

Pitch Shift

Time Stretch

Crush

Installation

You can install this package via pip install augaudio

Usage

Example usage:

import librosa
import augaudio
import soundfile

y, sr = librosa.load('audio.wav')

augmented = augaudio.augment(y, 1, 4)

soundfile.write('augmented.wav', augmented, sr)

Directly access one of the augmentations:

...
augmented = augaudio.GaussianNoise(y, 4)
...

Chain augmentations together:

...
augmented = augaudio.GaussianNoise(augaudio.TimeStretch(y, 2), 4)
...

Iterate over augmentations:

...
for augmentation in range(4):
  for intensity in range(1,10):
    augmented = augaudio.augment(y, augmentation, intensity)
    soundfile.write(str(augmentation) + '-' + str(intensity) + '.wav', augmented, sr)
...

Command Line Usage:

Single File:

augaudio /path/to/audio.wav 0 5

Complete Folder:

augaudio /path/to/input 0 5 /path/to/output

Augmentations

Augmentation index Description negative intensity
Augmentations -2 Applies /multiple/ random augmentations available
Random -1 Applies random augmentation available
GaussianNoise 0 Applies gaussian noise to the audio data n/a
PitchShift 1 Shifts the pitch of the audio data available
TimeStretch 2 Stretches the time of the audio data n/a
Crush 3 Crushes details by applying and reversing a pitch shift available

Copyright Notice

Copyright 2020 Bastian Schwickert

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

augaudio's People

Contributors

basti564 avatar jandornhege avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

jandornhege

augaudio's Issues

Error on importing Package

>>> import augaudio Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Jan\AppData\Local\Programs\Python\Python37\lib\site-packages\augaudio\__init__.py", line 1, in <module> import librosa as lr File "C:\Users\Jan\AppData\Local\Programs\Python\Python37\lib\site-packages\librosa\__init__.py", line 12, in <module> from . import core File "C:\Users\Jan\AppData\Local\Programs\Python\Python37\lib\site-packages\librosa\core\__init__.py", line 125, in <module> from .time_frequency import * # pylint: disable=wildcard-import File "C:\Users\Jan\AppData\Local\Programs\Python\Python37\lib\site-packages\librosa\core\time_frequency.py", line 11, in <module> from ..util.exceptions import ParameterError File "C:\Users\Jan\AppData\Local\Programs\Python\Python37\lib\site-packages\librosa\util\__init__.py", line 77, in <module> from .utils import * # pylint: disable=wildcard-import File "C:\Users\Jan\AppData\Local\Programs\Python\Python37\lib\site-packages\librosa\util\utils.py", line 15, in <module> from .decorators import deprecated File "C:\Users\Jan\AppData\Local\Programs\Python\Python37\lib\site-packages\librosa\util\decorators.py", line 9, in <module> from numba.decorators import jit as optional_jit ModuleNotFoundError: No module named 'numba.decorators'

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.