[package]
name = "decibri"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
description = "Cross-platform audio capture, playback, and voice activity detection for Rust"
readme = "README.md"
keywords = ["audio", "microphone", "capture", "sound", "voice"]
categories = ["multimedia::audio"]

[package.metadata.docs.rs]
# Build docs for all production targets to show platform-specific behavior.
# cpal backends (WASAPI on Windows, CoreAudio on macOS, ALSA on Linux) and
# ort loading paths differ per platform. Without explicit targets, docs.rs
# after 2026-05-01 would only build x86_64-unknown-linux-gnu.
targets = [
    "x86_64-unknown-linux-gnu",
    "aarch64-unknown-linux-gnu",
    "aarch64-apple-darwin",
    "x86_64-pc-windows-msvc",
]
# docs.rs uses ort-download-binaries since ort-load-dynamic requires a runtime
# dylib that docs.rs builders don't have. Mutually exclusive with ort-load-dynamic
# per the compile_error! guard in lib.rs.
features = ["capture", "playback", "vad", "denoise", "gain", "ort-download-binaries"]
no-default-features = true

[features]
# Default stack for consumers who want the full decibri experience on Node/Python bindings.
# `ort-load-dynamic` is the distribution mode used by the npm and Python packages.
default = ["capture", "playback", "vad", "denoise", "gain", "ort-load-dynamic"]

# Core feature set.
capture = ["dep:cpal", "dep:crossbeam-channel"]
playback = ["dep:cpal", "dep:crossbeam-channel"]
vad = ["dep:ort"]
denoise = []
gain = []

# ORT distribution mode (mutually exclusive; pick exactly one).
# A compile_error! guard in src/lib.rs enforces the exclusivity.
ort-load-dynamic = ["ort?/load-dynamic"]
ort-download-binaries = ["ort?/download-binaries", "ort?/tls-native"]

# Execution-provider passthrough features. Off by default.
# Enabled by bindings that want GPU acceleration on specific platforms.
coreml = ["ort?/coreml"]
cuda = ["ort?/cuda"]
directml = ["ort?/directml"]
rocm = ["ort?/rocm"]

[dependencies]
cpal = { workspace = true, optional = true }
thiserror = { workspace = true }
crossbeam-channel = { workspace = true, optional = true }
ort = { workspace = true, optional = true }
