SHA256
1
1
Fork
You've already forked sd2
1
Audio analysis tool https://beka.ovh/files/praca.pdf
  • Zig 99.4%
  • Shell 0.6%
fkobi 3dcf969e7b src/handle_funcs/handlePath: assign cwd separately
also removed type annotations
Signed-off-by: fkobi <fkobi@pm.me>
2026年06月22日 14:27:55 +02:00
LICENSES Release 1.0.0 2026年01月18日 14:39:14 +01:00
scripts Release 1.0.0 2026年01月18日 14:39:14 +01:00
src src/handle_funcs/handlePath: assign cwd separately 2026年06月22日 14:27:55 +02:00
.gitignore Release 1.0.0 2026年01月18日 14:39:14 +01:00
build.zig build.zig: use ReleaseFast by default 2026年02月02日 22:08:23 +01:00
build.zig.zon fix version numbers 2026年05月17日 12:20:37 +02:00
ChangeLog.md build.zig: use ReleaseFast by default 2026年02月02日 22:08:23 +01:00
README.org build.zig: use ReleaseFast by default 2026年02月02日 22:08:23 +01:00
REUSE.toml Release 1.0.0 2026年01月18日 14:39:14 +01:00

sd2 – Album analysis tool

Introduction

This software extracts the following characteristics from audio files:

  • maximum True Peak Level
  • Integrated Loudness (full scale)
  • Loudness Range
  • average RMS
  • average CREST
  • average Peak to Loudness Ratio

It is:

  • EBU R 128 compliant
  • optimised for bulk folder (album) analysis
  • quick
  • ergonomic
  • portable
  • libre

Origin

This project was concieved as I grew tired of using XiVero's MusicScope which was slow, not made for mass analysis, windows-only and proprietary. This is basically a rewrite of it's album analysis functionalities.

The first C prototype was created in 2024 and the Zig rewrite took place in 2025.

Also this project was my engineering thesis.

Installation

Prerequisites

This software is written in Zig. To see the minimal version required to compile this project see the build.zig.zon file.

It also uses the following libraries:

  • C sndfile for reading sound files
  • C ebur128 for complex audio analysis
  • Zig yazap for the CLI
  • Zig zig-time for human readable timestamps in reports (optional)

C libraries need to be installed by the system package manager while the Zig ones are fetched automatically and statically linked.

Compilation

To compile this project follow the standard Zig protocol and run zig build at the root of this repository.

Compile-time options

This project has a couple of compile-time options that can be switched with -D<option>=<bool>:

  • with_time enables human readable timestamps in reports
  • small_float enbles using 16bit float for storing analysis data

Usage

Just give the software a path to some TARGETS (folders and/or files)!

An analysed file's characteristics will be printed to stdout and folder's will be saved to a report in that folder.

Sample folder analysis

$ sd2 /path/to/target/
info: Analyzing 3 files in folder: target
info: Analyzed: intro.flac
info: Analyzed: track.flac
info: Analyzed: outro.flac
info: Report generated!

Sample report.org file

#+TITLE: Audio analysis report
#+SUBTITLE: for folder "Hybrid_Theory"
#+DATE: 2000年10月24日 12:34:56 UTC
#+ORIGIN: sd2 1.0.0
| File name | BD | SR [Hz] | mTPL | I-LUFS | LRA | aRMS | aCREST | aPLR |
|------------------------------------|----|---------|------|--------|-------|-------|--------|------|
| 101_Papercut.flac | 24 | 48000 | 1.0 | -6.84 | 2.8 | 0.3 | 3.10 | 6.9 |
| 102_One_Step_Closer.flac | 24 | 48000 | 1.0 | -6.56 | 3.7 | 0.3 | 3.12 | 6.6 |
| 103_With_You.flac | 24 | 48000 | 1.0 | -6.43 | 4.3 | 0.3 | 3.14 | 6.5 |
...

Contributing

This project is hosted at Codeberg and uses the default contributing features of Forgejo; issues and PRs are welcome.

For security issues and anything else I can be reached via email. You will find it in the details of my hosting account.