praudio provides audio preprocessing framework for Deep Learning audio applications

Related tags

Audiopraudio
Overview

README

praudio provides objects and a script for performing complex preprocessing operations on entire audio datasets with one command.

praudio is implemented having Deep Learning audio/music applications in mind.

Operations are carried out on CPU. Preprocessing can also be run on-the-fly, for example, while training a model.

The library uses librosa as an audio processing backend.

How do I install the library?

You can install praudio both with pip via PyPi, and by cloning the praudio repo from GitHub.

For both approaches, it's advisable to use a dedicated Python virtual environment.

Installing from PyPi

Installing from PyPi is the easiest option. In the terminal type:

$ pip install praudio

Installing from GitHub

First, you should clone the repository from GitHub:

$ git clone [email protected]:musikalkemist/praudio.git

Then, move to the project root and, to install the package, type in the terminal:

$ pip install .

You can also use a rule in the available Makefile (see below):

$ make install 

To install the package in development mode use:

$ pip install -e .[testing]

You can also use a rule in Makefile:

$ make install_dev 

This will install all the packages necessary to run the tests, lint, type checker. It will also install the package in 'editable' mode, which is ideal for development.

Python version

praudio works in Python 3.6, 3.7, 3.8.

How do I preprocess an audio dataset?

The core of the library is the preprocess entry point. This script works with a config file. You set the type of preprocessing you want to apply in a yaml file, and then run the script. Your dataset will be entirely preprocessed and the results recursively stored in a directory of your choice that can potentially be created from scratch.

To run the entry point, ensure the library is installed and then type:

$ preprocess /path/to/config.yml

In the config.yml, you should provide the following parameters:

  • dataset_dir: Path to the directory where your audio dataset is stored
  • save_dir: Path where to save the preprocessed audio.
  • Under file_preprocessor, you should provide settings for loader and transforms_chain.
  • loader: Provide settings for the loader.
  • transforms_chain: Parameters for each transform in the sequence. of transforms which are applied to your data (i.e., TransformChain).

These config parameters are used to dinamically initialise the relative objects in the library. To learn what parameters are available at each level in the config file, please refer to the docstrings in the relative objects.

Check out test/config.sampleconfig.yml to see an example of a valid config file.

Package structure

The package is divided into a number of subpackages:

  • config
  • creation
  • io
  • preprocessors
  • transforms

config has facilities to load, save, and validate configuration files, which are used to specify the types of preprocessing pipelines to use.

creation has classes that are responsible to instantiate key objects in the library.

io contains facilities to load / save audio signals from / to files.

preprocessors features objects which are responsible to preprocess single audio files, from loading to storing, as well as, batch of files.

transforms contains a series of objects which manipulate audio signals, such as short-time Fourier transform, log, scaling.

What's the Makefile for?

The Makefile has a series of rules that can be used to ensure quality of the code, and automate repetitive tasks.

Linter

The project uses pylint. The linter helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.

To run the linter type:

$ make lint

Typehint

The project uses mypy. mypy is an optional static type checker for Python. You can add type hints (PEP 484) to your Python programs, and use mypy to type check them statically.

To run the type checker type:

$ make typehint

Testing

The project uses pytest for unittests. Tests can be run in one go using coverage. This package suggests the percentage of code that is covered in unittests.

To run all the unittests type:

$ make test

Checklist

Checklist is a utility rule that runs the linter, type checker, and the test suite in one go:

$ make checklist

Clean

Use the clean rule to get rid of pyc files and __pychache__:

$ make clean

Dependencies

praudio has the following dependencies:

  • librosa==0.8.1
  • pyyaml==5.4.1
  • types-PyYAML==5.4.6

librosa is extensively used to extract audio features in transform objects.

Current limitations

The praudio preprocessors are capable of operating only on mono signals. This is a significant limitation if you are working in generative music. If you are using the library for audio / music analysis, this shouldn't be a problem.

Future improvements

  • Add audio augmentation / padding / cropping transforms.
  • Enable preprocessing of signals with multiple channels.
  • Turn transform parameters into full-fledged objects (e.g., STFTParams)
  • Instead of using a dictionary for configurations, instantiate parameter objects with validation
  • Implement different types of Savers / Loaders with factories to produce them.
Owner
Valerio Velardo
AI audio/music researcher. Love Python.
Valerio Velardo
Real-time audio visualizations (spectrum, spectrogram, etc.)

Friture Friture is an application to visualize and analyze live audio data in real-time. Friture displays audio data in several widgets, such as a sco

Timothรฉe Lecomte 700 Dec 31, 2022
DCL - An easy to use diacritic library used for diacritic and accent manipulation.

Diacritics Library This library is used for adding, and removing diacritics from strings. Getting started Start by importing the module: import dcl DC

Kreus Amredes 6 Jun 03, 2022
Pianote - An application that helps musicians practice piano ear training

Pianote Pianote is an application that helps musicians practice piano ear traini

3 Aug 17, 2022
Stream Music ๐ŸŽต ๐˜ผ ๐™—๐™ค๐™ฉ ๐™ฉ๐™๐™–๐™ฉ ๐™˜๐™–๐™ฃ ๐™ฅ๐™ก๐™–๐™ฎ ๐™ข๐™ช๐™จ๐™ž๐™˜ ๐™ค๐™ฃ ๐™๐™š๐™ก๐™š๐™œ๐™ง๐™–๐™ข ๐™‚๐™ง๐™ค๐™ช๐™ฅ ๐™–๐™ฃ๐™™ ๐˜พ๐™๐™–๐™ฃ๐™ฃ๐™š๐™ก ๐™‘๐™ค๐™ž๐™˜๐™š ๐˜พ๐™๐™–๐™ฉ๐™จ ๐˜ผ๐™ซ๐™–๐™ž๐™ก?

Stream Music ๐ŸŽต ๐˜ผ ๐™—๐™ค๐™ฉ ๐™ฉ๐™๐™–๐™ฉ ๐™˜๐™–๐™ฃ ๐™ฅ๐™ก๐™–๐™ฎ ๐™ข๐™ช๐™จ๐™ž๐™˜ ๐™ค๐™ฃ ๐™๐™š๐™ก๐™š๐™œ๐™ง๐™–๐™ข ๐™‚๐™ง๐™ค๐™ช๐™ฅ ๐™–๐™ฃ๐™™ ๐˜พ๐™๐™–๐™ฃ๐™ฃ๐™š๐™ก ๐™‘๐™ค๐™ž๐™˜๐™š ๐˜พ๐™๐™–๐™ฉ๐™จ ๐˜ผ๐™ซ๐™–๐™ž๐™ก?

Sadew Jayasekara 15 Nov 12, 2022
nicfit 425 Jan 01, 2023
A python wrapper for REAPER

pyreaper A python wrapper for REAPER (Robust Epoch And Pitch EstimatoR) Installation pip install pyreaper Demonstration notebnook http://nbviewer.jupy

Ryuichi Yamamoto 56 Dec 27, 2022
digital audio workstation, instrument and effect plugins, wave editor

digital audio workstation, instrument and effect plugins, wave editor

306 Jan 05, 2023
python wrapper for rubberband

pyrubberband A python wrapper for rubberband. For now, this just provides lightweight wrappers for pitch-shifting and time-stretching. All processing

Brian McFee 106 Nov 28, 2022
This is a python package that turns any images into MIDI files that views the same as them

image_to_midi This is a python package that turns any images into MIDI files that views the same as them. This package firstly convert the image to AS

Rainbow Dreamer 4 Mar 10, 2022
Deep learning transformer model that generates unique music sequences.

music-ai Deep learning transformer model that generates unique music sequences. Abstract In 2017, a new state-of-the-art was published for natural lan

xacer 6 Nov 19, 2022
Dataset and baseline code for the VocalSound dataset (ICASSP2022).

VocalSound: A Dataset for Improving Human Vocal Sounds Recognition Introduction Citing Download VocalSound Dataset Details Baseline Experiment Contact

Yuan Gong 58 Jan 03, 2023
An Amazon Music client for Linux (unpretentious)

Amusiz An Amazon Music client for Linux (unpretentious) โ†—๏ธ Install You can install Amusiz in multiple ways, choose your favorite. ๐Ÿš€ AppImage Here you

Mirko Brombin 25 Nov 08, 2022
Some utils for auto speech recognition

About Some utils for auto speech recognition. Utils Util Description Script Reset audio Reset sample rate, sample width, etc of audios.

1 Jan 24, 2022
Minimal command-line music player written in Python

pyms Minimal command-line music player written in Python. Designed with elegance and minimalism. Resizes dynamically with your terminal. Dependencies

12 Sep 23, 2022
:speech_balloon: SpeechPy - A Library for Speech Processing and Recognition: http://speechpy.readthedocs.io/en/latest/

SpeechPy Official Project Documentation Table of Contents Documentation Which Python versions are supported Citation How to Install? Local Installatio

Amirsina Torfi 870 Dec 27, 2022
A bot that can play music on Telegram Group and Channel Voice Chats

DaisyXmusic โค is the best and only Telegram VC player with playlists, Multi Playback, Channel play and more

TeamOfDaisyX 20 Jun 11, 2021
The venturimeter works on the principle of Bernoulli's equation, i.e., the pressure decreases as the velocity increases.

The venturimeter works on the principle of Bernoulli's equation, i.e., the pressure decreases as the velocity increases. The cross-section of the throat is less than the cross-section of the inlet pi

Shankar Mahadevan L 1 Dec 03, 2021
All-In-One Digital Audio Workstation and Plugin Suite

How to install Windows Mac OS X Fedora Ubuntu How to Build Debian and Ubuntu Fedora All Other Linux Distros Mac OS X Windows What is MusiKernel? MusiK

j3ffhubb 111 Sep 21, 2021
Conferencing Speech Challenge

ConferencingSpeech 2021 challenge This repository contains the datasets list and scripts required for the ConferencingSpeech challenge. For more detai

73 Nov 29, 2022
Graphical interface to control granular sound synthesis.

Granular sound synthesis interface SoundGrain is a graphical interface where users can draw and edit trajectories to control granular sound synthesis

Olivier Bรฉlanger 122 Dec 10, 2022