choon 0.2.0

Check that lossless audio is actually lossless
Documentation
[package]
name = "choon"
description = "Check that lossless audio is actually lossless"
version = "0.2.0"
edition = "2024"
rust-version = "1.95"
license = "AGPL-3.0-only"
repository = "https://github.com/tetra-fox/choon"
readme = "README.md"
keywords = ["audio", "flac", "lossless", "transcode", "spectrum"]
categories = ["multimedia::audio", "command-line-utilities"]
include = ["/src/", "/README.md", "/LICENSE"]

[features]
default = ["cli"]
# the `choon` program; a library user turns default features off and builds none of it
cli = [
  "dep:anstream",
  "dep:anstyle",
  "dep:clap",
  "dep:comfy-table",
  "dep:console",
  "dep:ctrlc",
  "dep:indicatif",
  "dep:serde_json",
  "dep:walkdir",
  "serde",
]
# `Serialize` and `Deserialize` on the thresholds and the measures, `Serialize` on the reading
serde = ["dep:serde"]
# the generated audio and the sample files the analyzer is tested on, for the program's tests here
# and the tests of the crates that use this one
testing = [
  "dep:flacenc",
  "dep:mp3lame-encoder",
  "dep:opus",
  "dep:oxideav-ape",
  "wavicle/encode",
]

# docs.rs shows what `serde` adds; `testing` builds LAME and libopus, which it cannot
[package.metadata.docs.rs]
features = ["serde"]

[[bin]]
name = "choon"
path = "src/main.rs"
required-features = ["cli"]

[dependencies]
# runs the codec grid scan's stretches side by side
rayon = "1.12.0"
realfft = "3.5.1"
# the half-length complex transform of the codec grid scan's DCT-IV
rustfft = "6.4.1"
# decodes AAC, with the HE-AAC that symphonia's decoder leaves out. pinned to the release checked
# against ffmpeg's decode and fuzzed; without its SIMD, which is where most of its unsafe code is
rusty_aac = { version = "=2.0.2", default-features = false }
# decodes Monkey's Audio. pinned to the release checked sample for sample against the reference
# decoder and fuzzed
ape-decoder = "=0.3.2"
# decodes WavPack. pinned to the release checked sample for sample against wvunpack and fuzzed
wavicle = "=0.1.0"
serde = { version = "1.0.229", features = ["derive"], optional = true }
# decodes FLAC, ALAC, PCM, MP3 and Vorbis, and reads the containers of the other decoders' codecs
symphonia = { version = "0.6.1", features = ["all"] }
symphonia-common = "0.6.1"
# decodes Opus, which symphonia does not. pinned to the release checked against the Opus test
# vectors and libopus
symphonia-opus = "=0.1.3"
tracing = "0.1.44"

# for the program: arguments, the walk of a directory, the terminal's progress, colour and tables
anstream = { version = "1.0.0", optional = true }
anstyle = { version = "1.0.14", optional = true }
clap = { version = "4.6.7", features = ["derive"], optional = true }
# custom_styling measures a cell around the colour codes already in its text
comfy-table = { version = "8.0.1", features = [
  "custom_styling",
], optional = true }
console = { version = "0.16.6", optional = true }
# the handler of an interrupt; termination makes SIGTERM and SIGHUP one too
ctrlc = { version = "3.5.3", features = ["termination"], optional = true }
# without its wasm support
indicatif = { version = "0.18.6", default-features = false, features = [
  "unicode-width",
], optional = true }
walkdir = { version = "2.5.0", optional = true }
# a float written and read back is the same float, to its last digit
serde_json = { version = "1.0.154", features = [
  "float_roundtrip",
], optional = true }

# make the lossless and lossy audio the analyzer is tested on. mp3lame-encoder builds the LAME
# source it carries with autotools (`configure`, `make`, a C compiler), and opus builds the
# libopus source it carries with CMake
flacenc = { version = "0.5.1", default-features = false, optional = true }
mp3lame-encoder = { version = "0.3.0", optional = true }
opus = { version = "0.4.0", optional = true }
# writes Monkey's Audio, without the framework it can register itself in
oxideav-ape = { version = "=0.0.5", default-features = false, optional = true }

[dev-dependencies]
# the crate itself with `testing`, for the generated audio its tests read
choon = { path = ".", features = ["testing", "serde"] }
proptest = "1.12.0"
serde_json = { version = "1.0.154", features = ["float_roundtrip"] }
tempfile = "3.27.0"

[[test]]
name = "cli"
required-features = ["cli"]

[lints.rust]
unsafe_code = "forbid"

[lints.clippy]
all = { level = "warn", priority = -1 }

# a release build with these reads about 2% faster and is about a quarter smaller, and takes
# three to four times as long to compile. `cargo install` builds with this profile, a crate
# that depends on the library builds it with its own
[profile.release]
lto = "fat"
codegen-units = 1

# the transforms and decoders are slow unoptimized; tests analyze audio
[profile.dev.package.choon]
opt-level = 3

[profile.dev.package.rustfft]
opt-level = 3

[profile.dev.package.symphonia-bundle-mp3]
opt-level = 3

[profile.dev.package.symphonia-bundle-flac]
opt-level = 3

[profile.dev.package.symphonia-core]
opt-level = 3

[profile.dev.package.symphonia-opus]
opt-level = 3

[profile.dev.package.ape-decoder]
opt-level = 3

[profile.dev.package.wavicle]
opt-level = 3

[profile.dev.package.rusty_aac]
opt-level = 3

# the encoders the tests make audio with
[profile.dev.package.flacenc]
opt-level = 3

[profile.dev.package.mp3lame-sys]
opt-level = 3