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
PianoPlayer - Automatic fingering generator for piano scores

PianoPlayer - Automatic fingering generator for piano scores

Marco Musy 571 Jan 02, 2023
The project aims to develop a personal-assistant for Windows & Linux-based systems

The project aims to develop a personal-assistant for Windows & Linux-based systems. Samiksha draws its inspiration from virtual assistants like Cortana for Windows, and Siri for iOS. It has been desi

SHUBHANSHU RAI 1 Jan 16, 2022
🎵 A music bot for discord servers!

music bot A music bot for Discord Servers Features Play songs in your discord server Get the lyrics without going on a web explorer Commands Command P

1 Jul 25, 2022
Analysis of voices based on the Mel-frequency band

Speaker_partition_module Analysis of voices based on the Mel-frequency band. Goal: Identification of voices speaking (diarization) and calculation of

1 Feb 06, 2022
Implicit neural differentiable FM synthesizer

Implicit neural differentiable FM synthesizer The purpose of this project is to emulate arbitrary sounds with FM synthesis, where the parameters of th

Andreas Jansson 34 Nov 06, 2022
Extract the songs from your osu! libary into proper mp3 form, complete with metadata and album art!

osu-Extract Extract the songs from your osu! libary into proper mp3 form, complete with metadata and album art! Requirements python3 mutagen pillow Us

William Carter 2 Mar 09, 2022
ᴀ ʙᴏᴛ ᴛʜᴀᴛ ᴄᴀɴ ᴘʟᴀʏ ᴍᴜꜱɪᴄ ɪɴ ᴛᴇʟᴇɢʀᴀᴍ ɢʀᴏᴜᴘ ᴏɴ ᴠᴏɪᴄᴇ ᴄᴀʟʟ

GJ516 LOVER'S ııllıllı ♥️ ➤⃝Gᴊ516_ᴍᴜꜱɪᴄ_ʙᴏᴛ ♥️ ıllıllı ᴀ ʙᴏᴛ ᴛʜᴀᴛ ᴄᴀɴ ᴘʟᴀʏ ᴍᴜꜱɪᴄ ɪɴ ᴛᴇʟᴇɢʀᴀᴍ ɢʀᴏᴜᴘ ᴏɴ ᴠᴏɪᴄᴇ ᴄᴀʟʟ Requirements 📝 FFmpeg NodeJS nodesou

1 Nov 22, 2021
This is a realtime voice translator program which gets input from user at any language and converts it to the desired language that the user asks

This is a realtime voice translator program which gets input from user at any language and converts it to the desired language that the user asks ...

Mohan Ram S 1 Dec 30, 2021
TwitterMusicBot - A Twitter bot with Spotify integration.

A Twitter Music Bot 🤖 🎵 🎶 I created this project to learn more about APIs, so it only works for student purposes. Initially, delving into the Spoti

Gustavo Oliveira 2 Jan 02, 2022
Audio features extraction

Yaafe Yet Another Audio Feature Extractor Build status Branch master : Branch dev : Anaconda : Install Conda Yaafe can be easily install with conda. T

Yaafe 231 Dec 26, 2022
Royal Music You can play music and video at a time in vc

Royals-Music Royal Music You can play music and video at a time in vc Commands SOON String STRING_SESSION Deployment 🎖 Credits • 🇸ᴏᴍʏᴀ⃝🇯ᴇᴇᴛ • 🇴ғғɪ

2 Nov 23, 2021
Generating a structured library of .wav samples with Python.

sample-library Scripts for generating a structured sample library with Python Requires Docker about Samples are written to wave files in lib/. Differe

Ben Mangold 1 Nov 11, 2021
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
Multi-Track Music Generation with the Transfomer and the Johann Sebastian Bach Chorales dataset

MMM: Exploring Conditional Multi-Track Music Generation with the Transformer and the Johann Sebastian Bach Chorales Dataset. Implementation of the pap

102 Dec 08, 2022
Synthesia but open source, made in python and free

PyPiano Synthesia but open source, made in python and free Requirements are in requirements.txt If you struggle with installation of pyaudio, run : pi

DaCapo 11 Nov 06, 2022
A python program for visualizing MIDI files, and displaying them in a spiral layout

SpiralMusic_python A python program for visualizing MIDI files, and displaying them in a spiral layout For a hardware version using Teensy & LED displ

Gavin 6 Nov 23, 2022
Simple discord bot by @merive 🤖

Parzibot Powerful and Useful Discord Bot on Python. The source code of the bot is available to everyone. Parzibot uses English language. This is free

merive_ 3 Dec 28, 2022
commonfate 📦commonfate 📦 - Common Fate Model and Transform.

Common Fate Transform and Model for Python This package is a python implementation of the Common Fate Transform and Model to be used for audio source

Fabian-Robert Stöter 18 Jan 08, 2022
Improved Python UI to convert Youtube URL to .mp3 file.

YT-MP3 Improved Python UI to convert Youtube URL to .mp3 file. How to use? Just run python3 main.py Enter the URL of the video Enter the PATH of where

8 Jun 19, 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