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
Official implementation of A cappella: Audio-visual Singing VoiceSeparation, from BMVC21

Y-Net Official implementation of A cappella: Audio-visual Singing VoiceSeparation, British Machine Vision Conference 2021 Project page: ipcv.github.io

Juan F. Montesinos 12 Oct 22, 2022
Code for csig audio deepfake detection

FMFCC Audio Deepfake Detection Solution This repo provides an solution for the 多媒体伪造取证大赛. Our solution achieve the 1st in the Audio Deepfake Detection

BokingChen 9 Jun 04, 2022
PatrikZero's CS:GO Hearing protection

Program that lowers volume when you die and get flashed in CS:GO. It aims to lower the chance of hearing damage by reducing overall sound exposure. Uses game state integration. Anti-cheat safe.

Patrik Žúdel 224 Dec 04, 2022
NovaMusic is a music sharing robot. Users can get music and music lyrics using inline queries.

A music sharing telegram robot using Redis database and Telebot python library using Redis database.

Hesam Norin 7 Oct 21, 2022
Algorithmic and AI MIDI Drums Generator Implementation

Algorithmic and AI MIDI Drums Generator Implementation

Tegridy Code 8 Dec 30, 2022
Okaeri-Music is a telegram music bot project, allow you to play music on voice chat group telegram.

Okaeri-Music is a telegram bot project that's allow you to play music on telegram voice chat group

Wahyusaputra 1 Dec 22, 2021
Sequencer: Deep LSTM for Image Classification

Sequencer: Deep LSTM for Image Classification Created by Yuki Tatsunami Masato Taki This repository contains implementation for Sequencer. Abstract In

Yuki Tatsunami 111 Dec 16, 2022
voice assistant made with python that search for covid19 data(like total cases, deaths and etc) in a specific country

covid19-voice-assistant voice assistant made with python that search for covid19 data(like total cases, deaths and etc) in a specific country installi

Miguel 2 Dec 05, 2021
Gradient - A Python program designed to create a reactive and ambient music listening experience

Gradient is a Python program designed to create a reactive and ambient music listening experience.

Alexander Vega 2 Jan 24, 2022
Supysonic is a Python implementation of the Subsonic server API.

Supysonic Supysonic is a Python implementation of the Subsonic server API. Current supported features are: browsing (by folders or tags) streaming of

Alban 228 Nov 19, 2022
Analyze, visualize and process sound field data recorded by spherical microphone arrays.

Sound Field Analysis toolbox for Python The sound_field_analysis toolbox (short: sfa) is a Python port of the Sound Field Analysis Toolbox (SOFiA) too

Division of Applied Acoustics at Chalmers University of Technology 69 Nov 23, 2022
MelGAN test on audio decoding

Official repository for the paper MelGAN: Generative Adversarial Networks for Conditional Waveform Synthesis The original work URL: https://github.com

Jurio 1 Apr 29, 2022
Jarvis From Basic to Advance - make a voice assistant similar to JARVIS (in iron man movie)

JARVIS (Basic to Advance) This was my attempt to make a voice assistant similar to JARVIS (in iron man movie) Let's be honest, it's not as intelligent

codesempai 17 Dec 25, 2022
Datamoshing with FFmpeg

ffmosher Datamoshing with FFmpeg Drag and drop video onto mosh.bat to create a datamoshed video. To datamosh an image, please ensure the file is in a

18 Sep 11, 2022
Omniscient Mozart, being able to transcribe everything in the music, including vocal, drum, chord, beat, instruments, and more.

OMNIZART Omnizart is a Python library that aims for democratizing automatic music transcription. Given polyphonic music, it is able to transcribe pitc

MCTLab 1.3k Jan 08, 2023
gentle forced aligner

Gentle Robust yet lenient forced-aligner built on Kaldi. A tool for aligning speech with text. Getting Started There are three ways to install Gentle.

1.2k Dec 30, 2022
This is an OverPowered Vc Music Player! Will work for you and play music in Voice Chatz

VcPlayer This is an OverPowered Vc Music Player! Will work for you and play music in Voice Chatz Telegram Voice-Chat Bot [PyTGCalls] ⇝ Requirements ⇜

1 Dec 20, 2021
A simple python script to play bell sound in your system infinitely, just for fun and experimental purposes

A simple python script to play bell sound in your system infinitely, just for fun and experimental purposes

نافع الهلالي 1 Oct 29, 2021
Official implementation of A cappella: Audio-visual Singing VoiceSeparation, from BMVC21

Y-Net Official implementation of A cappella: Audio-visual Singing VoiceSeparation, British Machine Vision Conference 2021 Project page: ipcv.github.io

Juan F. Montesinos 12 Oct 22, 2022
Tradutor de um arquivo MIDI para ser usado em um simulador RISC-V(RARS)

Tradutor_MIDI-RISC-V Tradutor de um arquivo MIDI para ser usado em um simulador RISC-V(RARS) *O resultado sai com essa formatação: nota,duração,nota,d

Gabriel B. G. 4 Sep 02, 2022