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.
- Each archive holds the command-line tool (
encspect, orencspect.exeon Windows), the graphical app, the license and the third-party notices. - On x64, choose between the plain archive and the
-v3one for processors with AVX2, and expect Windows and macOS to ask before the first run, because the programs are not signed: both are explained under Which archive, and the first run. - The tool needs no .NET installation.
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.
encspect song.mp3
encspect song.mp3 album.flac
encspect ~/Music/album
- A folder is analyzed with all its subfolders, hidden files included, in the order of their paths.
- Detection looks at the bytes, not the file extension.
- Reports are written as each file is finished, so a long run starts printing at once.
- A WavPack or OptimFROG file is reported together with its correction file when that sits beside it.
- Standard input is not read. After
--, every argument is a file or folder, even one that starts with a dash.
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.
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.
--learnencspect --learnlists the background articles andencspect --learn mid-side-stereoprints 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-oninfo,warningorerror: 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.
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
- A tree. The file is at the top, then its streams, frames, tags and other parts as nested lines. Every line is a field the parser read, with its value and unit.
- Findings. Anything odd, such as truncation, a broken checksum or a tag that breaks its specification, is listed as a finding with a severity (info, warning or error) that points at the node it concerns. Damaged files get findings, not crashes.
- Encoder and writer. The encoder named by the stream’s own evidence, and the software that wrote the container, each with a confidence.
- Verified. With
--verify, a stream that stores checksums gets a line that readsyes,noorunknown, with the details in parentheses. - Measurements. With
--measure, lines such as these appear under the stream, each with its basis:
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-onsays. 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.