Command Line

The encspect program reads audio files and prints what is inside them: the structure, the encoder, the tags, the checksums and any damage. It works on one file, several files or a whole folder.

Installing

There is no installer. Download the archive for your system from the latest release page, unpack it and run the program from the folder it creates. Archives are named encspect-<version>-<platform>: Windows (.zip), macOS and Linux (.tar.gz), on x64 and ARM64.

Unpack and check (Linux and macOS)
tar xzf encspect-<version>-<platform>.tar.gz
cd encspect-<version>-<platform>
./encspect --version

Everyday commands

The general form is encspect [options] [--] <file-or-folder>.... encspect --help lists every option.

Analyze files and folders
encspect song.mp3
encspect song.mp3 album.flac
encspect ~/Music/album

Choosing the output

The default is a text tree. Three other outputs are meant for scripts and spreadsheets, and all four are UTF-8.

--json
One JSON array of reports.
--ndjson
One compact report per line, which stays usable line by line if a long run stops early.
--csv
One summary row per file: format, codec, duration, bitrate, sample rate, channels, encoder, tags, finding counts and more.
Write a report to a file
encspect --json ~/Music/album > album.json
encspect --csv ~/Music > library.csv

Options you will use

--verify
Decodes the audio while reading it and compares the checksums that cover decoded audio, such as FLAC’s MD5, for the formats that have a decoder. Without it, only checksums over the coded data are compared. It takes noticeably longer.
--measure
Decodes the audio and adds figures to the report: the spectrum and spectral cutoff, the inter-channel coherence of a stereo pair, levels (sample peak, RMS level, clipping, digital silence), loudness and true peak. A list after it picks kinds: --measure spectrum,levels. The figures are measurements with units; they are never verdicts.
--offsets
Adds the byte offset and length of every node to the text tree, such as [0x1A, 4 bytes]. JSON always has them.
--hide
Leaves sections out of the text tree and JSON: tags, frames, side-info, statistics, measurements.
--explain
Adds a plain description of what each node is, and the background topic it belongs to.
--learn
encspect --learn lists the background articles and encspect --learn mid-side-stereo prints one.
--only-format
Analyzes only the files whose detected format starts with a name, such as --only-format flac. Several names are separated by commas. Handy for a folder of mixed files.
--as
Skips format detection and analyzes every file as the named format, for a damaged file that detection does not recognize: --as aac damaged.bin. The report says it was forced.
--fail-on
info, warning or error: makes the exit code 1 when a finding of that severity or worse turns up.
--version
Prints the version, with the commit the build was made from.
Examples
encspect --verify album.flac
encspect --measure --json song.mp3 > song.json
encspect --only-format mp3 --csv ~/Music > mp3s.csv
encspect --fail-on warning --verify ~/Music/flac

Some combinations make no sense and are rejected as wrong usage, for example --offsets with --csv, or --as with --only-format.

Reading the text output

An excerpt of measured figures
Spectral Cutoff: 16,796 Hz (a step of 59.1 dB, transition from 16,538 Hz, in 20 of 20 frames with signal), measured from the decoded audio
Sample Peak: -8.7 dBFS
Integrated Loudness: -20.4 LUFS
Maximum True Peak Level: -8.6 dBTP

Encspect does not play or convert audio. It decodes only to check checksums and to measure.

Exit codes

Scripts can rely on these.

0
Success.
1
Findings, as --fail-on says.
2
Wrong usage.
3
A file or folder could not be read, or is not a regular file.
4
The output could not be written, as on a full disk; the run stops there.

A file that cannot be read still gets a report with an error finding, so JSON and CSV list every input. A closed pipe, as with | head, is not an error.

The full reference

Every option, the JSON report in detail, the CSV columns and the measurements are described in the command-line documentation on GitHub. Prefer windows? See the graphical app.