[package]
name = "audio_samples"
version = "2.0.0"
edition = "2024"
rust-version = "1.87"
authors = ["Jack Geraghty <jgeraghty049@gmail.com>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/jmg049/audio_samples"
repository = "https://github.com/jmg049/audio_samples"
documentation = "https://docs.rs/audio_samples"
description = "A typed audio processing library for Rust that treats audio as a first-class, invariant-preserving object rather than an unstructured numeric buffer."
keywords = ["audio", "dsp", "api"]
categories = ["encoding", "multimedia", "science"]
[package.metadata.docs.rs]
features = ["full"]
rustdoc-args = ["--cfg", "docsrs"]
[lib]
name = "audio_samples"
crate-type = ["rlib"]
[lints.rust]
unused_unsafe = "allow"
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(docsrs)"] }
[lints.clippy]
unit_cmp = "deny"
match_same_arms = "warn"
inefficient_to_string = "deny"
map_clone = "deny"
unnecessary_to_owned = "deny"
large_stack_arrays = "deny"
box_collection = "deny"
vec_box = "deny"
needless_collect = "deny"
redundant_clone = "deny"
needless_return = "deny"
let_unit_value = "deny"
manual_map = "deny"
unnecessary_wraps = "allow"
missing_safety_doc = "warn"
undocumented_unsafe_blocks = "warn"
result_large_err = "allow"
missing_const_for_fn = "allow"
collapsible_if = "allow"
missing_panics_doc = "allow"
needless_borrows_for_generic_args = "allow"
if_same_then_else = "allow"
unnecessary_cast = "allow"
identity_op = "allow"
unwrap_used = "allow"
panic = "allow"
panic_in_result_fn = "allow"
missing_errors_doc = "allow"
exhaustive_enums = "allow"
exhaustive_structs = "allow"
too_many_arguments = "allow"
too_many_lines = "allow"
module_name_repetitions = "allow"
cast_precision_loss = "allow"
cast_possible_truncation = "allow"
cast_sign_loss = "allow"
cast_possible_wrap = "allow"
needless_pass_by_value = "allow"
tuple_array_conversions = "allow"
unsafe_derive_deserialize = "allow"
multiple_unsafe_ops_per_block = "allow"
doc_markdown = "allow"
incompatible_msrv = "warn"
[dependencies]
bytemuck = "1.25.0"
ndarray = "0.17"
num-traits = "0.2"
thiserror = "2.0"
miette = "7"
num-complex = "0.4"
i24 = { version = "2.3.4", features = [
"alloc",
"num-cast",
"ndarray",
"std",
] }
serde = { version = "1.0", features = ["derive"], optional = true }
rand = { version = "0.10.2", optional = true }
wide = { version = "1.5.0", optional = true }
spectrograms = { version = "2.1.0", optional = true }
serde_json = { version = "1.0.150", optional = true }
plotly = { version = "0.14.1", optional = true }
plotly_static = { version = "0.1.0", features = [
"chromedriver",
"webdriver_download",
], optional = true }
html_view = { version = "0.2.2", optional = true }
base64 = { version = "0.22", optional = true }
rubato = { version = "3.0.0", optional = true }
rayon = { version = "1.12.0", optional = true }
explainable = { version = "0.1.1", optional = true }
term-maths = { version = "1.0.0", optional = true }
open = { version = "5.3.6", optional = true }
rustfft = { version = "6.2", optional = true }
non-empty-slice = "0.6"
non-empty-iter = "0.3.1"
audioadapter = { version = "3.0.0", optional = true }
audioadapter-buffers = { version = "3.0.0", optional = true }
[features]
default = ["bare-bones"]
fancy = ["miette/fancy"]
statistics = []
processing = ["statistics"]
transforms = ["dep:spectrograms", "dep:rustfft"]
editing = [
"statistics",
"random-generation",
]
beat-tracking = ["onset-detection"]
onset-detection = [
"transforms",
"peak-picking",
"processing",
]
decomposition = [
"onset-detection",
]
dynamic-range = []
channels = []
iir-filtering = []
parametric-eq = ["iir-filtering", "channels"]
peak-picking = []
pitch-analysis = ["transforms"]
resampling = ["dep:rubato", "dep:rayon", "audioadapter", "audioadapter-buffers"]
vad = []
psychoacoustic = ["transforms"]
parallel = ["dep:rayon"]
opus-codec = ["psychoacoustic", "statistics"]
plotting = ["dep:plotly", "dep:base64", "dep:serde_json", "channels", "transforms", "editing"]
envelopes = [
"dynamic-range",
"editing",
"dep:rustfft"
]
fixed-size-audio = [
]
full = ["full_no_plotting", "plotting"]
full_no_plotting = [
"statistics",
"editing",
"transforms",
"channels",
"resampling",
"fixed-size-audio",
"beat-tracking",
"onset-detection",
"decomposition",
"dynamic-range",
"parametric-eq",
"peak-picking",
"pitch-analysis",
"processing",
"vad",
"iir-filtering",
"envelopes",
"random-generation",
"psychoacoustic",
"parallel",
"opus-codec",
]
educational = ["dep:explainable", "dep:term-maths", "dep:open", "processing", "fancy"]
bare-bones = []
static-plots = ["plotting", "dep:plotly_static", "dep:serde", "i24/serde"]
simd = ["dep:wide"]
random-generation = ["dep:rand"]
python = ["i24/pyo3"]
html_view = ["dep:html_view"]
[dev-dependencies]
approx_eq = "0.1.8"
clap = { version = "4.6.1", features = ["derive"] }
dtmf_tones = "1.0.1"
rand = "0.10.1"
criterion = { version = "0.8.2", features = ["html_reports"] }
proptest = "1.11.0"
[[example]]
name = "basics"
required-features = ["statistics"]
[[example]]
name = "statistics"
required-features = ["statistics"]
[[example]]
name = "utils_demo"
[[example]]
name = "detection"
[[example]]
name = "errors"
required-features = ["fancy"]
[[example]]
name = "error_diagnostics"
required-features = ["fancy"]
[[example]]
name = "processing"
required-features = ["processing", "editing", "transforms"]
[[example]]
name = "editing"
required-features = ["editing"]
[[example]]
name = "channels"
required-features = ["channels", "statistics"]
[[example]]
name = "transforms"
required-features = ["transforms", "statistics"]
[[example]]
name = "resampling"
required-features = ["resampling", "statistics", "processing"]
[[example]]
name = "iir_filtering"
required-features = ["iir-filtering", "editing", "statistics"]
[[example]]
name = "parametric_eq"
required-features = ["parametric-eq", "statistics"]
[[example]]
name = "dynamic_range"
required-features = ["dynamic-range", "statistics"]
[[example]]
name = "pitch_analysis"
required-features = ["pitch-analysis"]
[[example]]
name = "vad"
required-features = ["vad", "editing"]
[[example]]
name = "hpss"
required-features = ["decomposition", "statistics", "editing"]
[[example]]
name = "psychoacoustic"
required-features = ["psychoacoustic"]
[[example]]
name = "educational"
required-features = ["educational", "processing"]
[[example]]
name = "plotting_basic"
required-features = ["plotting", "transforms"]
[[example]]
name = "plotting_auto_zoom"
required-features = ["plotting", "transforms"]
[[example]]
name = "plotting_spectrum"
required-features = ["plotting", "transforms"]
[[example]]
name = "plotting_overlays"
required-features = ["plotting", "transforms"]
[[example]]
name = "plotting_composite_basics"
required-features = ["plotting", "transforms"]
[[example]]
name = "plotting_composite_advanced"
required-features = ["plotting", "envelopes"]
[[example]]
name = "plotting_configurable_padding"
required-features = ["plotting", "transforms"]
[[example]]
name = "plotting_dsp_overlays"
required-features = ["plotting", "statistics"]
[[example]]
name = "plotting_spectral_overlays"
required-features = ["plotting", "statistics"]
[[example]]
name = "plotting_event_markers"
required-features = ["plotting", "onset-detection", "beat-tracking", "statistics"]
[[test]]
name = "codec_quality"
required-features = ["psychoacoustic", "random-generation"]
[[test]]
name = "opus_codec_quality"
required-features = ["opus-codec", "random-generation"]
[[test]]
name = "processing_pipeline"
required-features = ["statistics", "processing", "editing", "transforms"]
[[test]]
name = "channel_pipeline"
required-features = ["channels", "processing", "editing"]
[[test]]
name = "effects_chain"
required-features = ["channels", "iir-filtering", "dynamic-range", "parametric-eq"]
[[test]]
name = "analysis_pipeline"
required-features = ["pitch-analysis", "vad"]
[[test]]
name = "proptest_invariants"
required-features = ["processing", "channels", "iir-filtering", "editing"]
[[test]]
name = "plotting_integration"
required-features = ["plotting"]
[[test]]
name = "educational_integration"
required-features = ["educational", "processing"]
[[bench]]
name = "filtering"
harness = false
required-features = ["iir-filtering", "processing", "editing", "statistics", "transforms"]
[[bench]]
name = "conversions"
harness = false
required-features = ["statistics", "channels"]
[[bench]]
name = "transforms"
harness = false
required-features = ["transforms", "statistics"]
[[bench]]
name = "generation"
harness = false
required-features = ["random-generation"]
[[bench]]
name = "dynamics"
harness = false
required-features = ["dynamic-range", "statistics"]