Skip to main content

Audio ML Spec Tools

Convenience functions for generating ML features from audio data. Breaks audio ML dependencies on torchaudio. Unlike pytorch features, these functions can be exported to ExecuTorch and ONNX with no issues.

Motivation

Except in specific circumstances like wav2vec, raw audio has proven to be a much worse input for ML models than spectrogram-based features across a wide variety of problem domains, including environmental sound classificarion (Guzhov et al. (2021)), singing technique classification (Yamamoto et al. (2021)), and ship classification (Xie, Ren, and Xu (2024)).

There is no scientific consensus on the relative benefits of mel-scale spectrograms, linear spectrograms, and MFCCs. Different researchers have shown good results with each type of spectrogram; see respectively Raponi, Oligeri, and Ali (2021), Jung at al. (2021), and Razani et al (2017).

With this library, you can easily try as many feature extraction methods as you want to see what works for your use case.

Prerequisites

  • Python 3.12 runtime
  • pip for package installation
  • Note that torchcodec depends on a system installation of FFmpeg

Installation

  • Install using pip:
pip install AudioMlSpecTools

Local Installation

Install the dependencies and library with pip:

pip install .

Usage

See examples/features.py.

Testing

# If needed, install test dependencies
# pip install .[test]

python3 -m coverage run -m unittest discover -s test -p "*_test.py" && python -m coverage report --skip-covered
python -m coverage html

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Ryan Quinn - Initial work

License

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audiomlspectools-0.15.0.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audiomlspectools-0.15.0-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file audiomlspectools-0.15.0.tar.gz.

File metadata

  • Download URL: audiomlspectools-0.15.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for audiomlspectools-0.15.0.tar.gz
Algorithm Hash digest
SHA256 0728fe5cbafa6beb00bca3ef03c1a97ea9afa4c3f088a260c40a6146efc0d0c5
MD5 cfca78ce91801d5f6e555226ef61900e
BLAKE2b-256 2d8b11f8363bc51f84c7aaf9cde1d65f036d605a4d2fd64f53204bda38a525cd

See more details on using hashes here.

File details

Details for the file audiomlspectools-0.15.0-py3-none-any.whl.

File metadata

File hashes

Hashes for audiomlspectools-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a78c8d96b6f61d55f8e43e275dc9746667ddaf5f7650ff7852a36f8f0193c7a0
MD5 1883d2bd43a58ec40391b9821ace881a
BLAKE2b-256 c1b541a3f8e846cb7281d06c0621ab1b370b249374966c3f636d36c5efe4c7dd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.15.0 This release

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 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