Skip to main content

GitHub top language PyPI - Python Version GitHub release (latest SemVer) GitHub issues CodeFactor GitHub last commit GitHub

pyACA

Python scripts accompanying the book "An Introduction to Audio Content Analysis" (www.AudioContentAnalysis.org). The source code shows example implementations of basic approaches, features, and algorithms for music audio content analysis.

functionality

The top-level functions are (alphabetical):

The names of the additional functions follow the following conventions:

design principles

Please note that the provided code examples are only intended to showcase algorithmic principles – they are not entirely suitable for practical usage without parameter optimization and additional algorithmic tuning. Rather, they intend to show how to implement audio analysis solutions and to facilitate algorithmic understanding to enable the reader to design and implement their own analysis approaches.

minimal dependencies

The required dependencies are reduced to a minimum, more specifically to only numpy and scipy, for the following reasons:

  • accessibility, i.e., clear algorithmic implementation from scratch without obfuscation by using 3rd party implementations,
  • maintainability through independence of 3rd party code. This design choice brings, however, some limitations; for instance, reading of non-RIFF audio files is not supported and the machine learning models are very simple.

readability

Consistent variable naming and formatting, as well as the choice for simple implementations allow for easier parsing. The readability of the source code will sometimes come at the cost of lower performance.

cross-language comparability

All code is matched exactly with Matlab implementations and the equations in the book. This also means that the python code might violate typical python style conventions in order to be consistent.

related repositories and links

The python source code in this repository is matched with corresponding source code in the Matlab repository.

Other, related repositories are

  • ACA-Slides: slide decks for teaching and learning audio content analysis
  • ACA-Plots: Matlab scripts for generating all plots in the book and slides

The main entry point to all book-related information is AudioContentAnalysis.org

getting started

installation

pip install pyACA 

code examples

example 1: computation and plot of the Spectral Centroid

import pyACA
import matplotlib.pyplot as plt 

# file to analyze
cPath = "c:/temp/test.wav"

# extract feature
[v, t] = pyACA.computeFeatureCl(cPath, "SpectralCentroid")

# plot feature output
plt.plot(t,np.squeeze(v))

example 2: Computation of two features (here: Spectral Centroid and Spectral Flux)

import pyACA

# read audio file
cPath = "c:/temp/test.wav"
[f_s, afAudioData] = pyACA.ToolReadAudio(cPath)

# compute feature
[vsc, t] = pyACA.computeFeature("SpectralCentroid", afAudioData, f_s)
[vsf, t] = pyACA.computeFeature("SpectralFlux", afAudioData, f_s)

Metadata

Release files for pyACA 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyACA 0.3.1
File Size Uploaded
pyACA-0.3.1.tar.gz 103.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyACA 0.3.1
File Interpreter ABI Platform
pyACA-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 160.7 kB

Release files / pyACA-0.3.1.tar.gz

Download URL pyACA-0.3.1.tar.gz
Size 103.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ab4240b274e78dd76aaec3e2741992f3ad7d2e4814096cb1a14236b4005f4840
BLAKE2b-256 checksum
How to use checksums
e7ec59d9c127208221f57f2acd9f859f114c56e369649fe019436f00c9610900
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release files / pyACA-0.3.1-py3-none-any.whl

Download URL pyACA-0.3.1-py3-none-any.whl
Size 57.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c94b673cf9ff5c6958c5e37e3dffc638f4ccfbbd5841637ce791eb876c44b9ce
BLAKE2b-256 checksum
How to use checksums
27ef604e8170f50d7a8f21afbd871010d5ac530bc8c7ad767028cb8fcb2e96a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page