Skip to main content

SpectralAudit

Offline spectral analysis for music and final masters. A Python library by Eduardo J. Barrios.

CI License: Apache-2.0

SpectralAudit measures high-frequency energy, spectral cutoffs and regularly spaced spectral peaks in WAV/FLAC audio. It also compares a premaster and final master to reveal measurable differences between versions. Processing runs locally with NumPy and SciPy: no LLMs, AI models or external APIs.

Important: SpectralAudit is not a validated detector of AI-generated music. Frequencies above 17 kHz, low-pass cutoffs and periodic peaks do not prove AI origin. Results are measurements with stated limitations.

Install

Requires Python 3.11+.

pip install spectralaudit

Before the first PyPI release, install from the repository:

pip install git+https://github.com/edujbarrios/spectralaudit.git

Quick start

Analyze a master and export an HTML and JSON report:

spectralaudit analyze final_master.wav --html report.html --json report.json

Inspect frequency bands, compare two versions, or analyze a folder:

spectralaudit spectrum final_master.wav
spectralaudit compare premaster.wav final_master.wav --html comparison.html
spectralaudit batch ./music --json batch.json

Python API:

from spectralaudit import analyze, compare_masters

report = analyze("final_master.wav")
print(report.findings["high_frequency"]["candidate_cutoff"])
print(report.findings["spectral_comb"]["candidate_periodicity"])
print(report.interpretation)  # Origin inconclusive: ...
report.to_html("report.html")

comparison = compare_masters("premaster.wav", "final_master.wav")
print(comparison.spectral_changes)

What it measures

  • Frequency bands: Welch power spectrum, relative band energy and candidate high-frequency cutoff, respecting the file's Nyquist limit.
  • Periodic peaks: spacing of narrow spectral peaks; also possible in conventional harmonic music.
  • Time: persistence of candidate patterns in successive audio windows.
  • Alternative explanations: flags for sample-rate and processing-related ambiguities.
  • Master comparison: estimated time offset, gain and band-level spectral differences.

The same inputs and settings produce deterministic analyses. Detection thresholds are exploratory heuristics, not calibrated AI-origin probabilities. Large files are read into memory; input audio is never modified. See Methods and Limitations.

Research, citation and license

If you use SpectralAudit in research, please cite Eduardo J. Barrios and the version used. See CITATION.cff and how to cite.

Selected scientific references:

  • Afchar et al. (2025), A Fourier Explanation of AI-music Artifacts (paper).
  • Cros Vila et al. (2025), The AI Music Arms Race (DOI).
  • Welch (1967), The Use of Fast Fourier Transform for the Estimation of Power Spectra (DOI).

Full bibliography and implementation distinctions: REFERENCES.md.

Copyright © 2026 Eduardo J. Barrios. Open source under the Apache License 2.0; see NOTICE. Redistribution must preserve applicable notices. Academic citation is requested, not an additional legal condition of the license.

Metadata

Release files for spectralaudit 0.1.0

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

Source distribution (sdist)

Source distribution for spectralaudit 0.1.0
File Size Uploaded Provenance Actions
spectralaudit-0.1.0.tar.gz 28.8 kB With provenance Details for spectralaudit-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 50.2 kB

Release files / spectralaudit-0.1.0.tar.gz

Download URL spectralaudit-0.1.0.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a7a213116c137dc92ecea182188cad419c5801b05fd7c61bb5ab21289201facf
BLAKE2b-256 checksum
How to use checksums
8a957f099a8f9a31c03bd2843dd2c96da15f878cc130d94cb6e836d8819be0e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / spectralaudit-0.1.0-py3-none-any.whl

Download URL spectralaudit-0.1.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c73f07dbca4303b471a0a6076061952dec3395668331ec7cc8db616120cfdfb0
BLAKE2b-256 checksum
How to use checksums
dd3c2003144fedda9620f941339ea2ec5f4489d7929ce43f982db9f5056166ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Security for spectralaudit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for spectralaudit-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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