Python Forum
A Python library for audio and music analysis, feature extraction
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Python library for audio and music analysis, feature extraction
Open source project:

AudioFlux is a library for audio and music analysis and feature extraction, which supports dozens of time-frequency analysis and transformation methods, as well as hundreds of corresponding time-domain and frequency-domain feature combinations, which can be provided to the deep learning network for training and can be used to study the classification, separation, music information retrieval (MIR), ASR and other tasks in the audio field.

[Image: feature_all.png]
[Image: flow.png]

Code Demo
An example of Mel and MFCC features.
pip install audioflux

import numpy as np
import audioflux as af

import matplotlib.pyplot as plt
from audioflux.display import fill_spec

# Get a 220Hz's audio file path
sample_path = af.utils.sample_path('220')

# Read audio data and sample rate
audio_arr, sr =

# Extract mel spectrogram
spec_arr, mel_fre_band_arr = af.mel_spectrogram(audio_arr, num=128, radix2_exp=12, samplate=sr)
spec_arr = np.abs(spec_arr)

# Extract mfcc
mfcc_arr, _ = af.mfcc(audio_arr, cc_num=13, mel_num=128, radix2_exp=12, samplate=sr)

# Display
audio_len = audio_arr.shape[0]
# calculate x/y-coords
x_coords = np.linspace(0, audio_len / sr, spec_arr.shape[1] + 1)
y_coords = np.insert(mel_fre_band_arr, 0, 0)
fig, ax = plt.subplots()
img = fill_spec(spec_arr, axes=ax,
                x_coords=x_coords, y_coords=y_coords,
                x_axis='time', y_axis='log',
                title='Mel Spectrogram')
fig.colorbar(img, ax=ax)

fig, ax = plt.subplots()
img = fill_spec(mfcc_arr, axes=ax,
                x_coords=x_coords, x_axis='time',
fig.colorbar(img, ax=ax)
[Image: 69718097d4dc05c9e6ea1367214fbd57.png]

Possibly Related Threads…
Thread Author Replies Views Last Post
  Feature Extraction and Modeling Pipeline FelixLarry 1 1,026 Sep-07-2022, 09:42 AM
Last Post: Larz60+
  The Python Tkinter Youtube Audio Downloader for Linux rootVIII 0 2,112 Dec-19-2018, 11:33 PM
Last Post: rootVIII

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020