[package]
name = "mel_spec"
version = "0.4.0"
edition = "2021"
license = "MIT"
description = "Mel spectrograms aligned to the results from the whisper.cpp, pytorch and librosa reference implementations and suited to streaming audio."
repository = "https://github.com/wavey-ai/mel-spec"
readme = "README.md"
build = "build.rs"

exclude = ["examples", "pkg", "doc", "testdata/*"]

[dependencies]
image = "0.24.6"
ndarray = "0.16.1"
ndarray-npy = "0.9.1"
num = "0.4.1"
rustfft = { version = "6.2.0" }
bytemuck = { version = "1.22.0", features = ["derive"], optional = true }
js-sys = { version = "^0.3", optional = true }
pollster = { version = "0.4.0", optional = true }
wasm-bindgen = { version = "^0.2", optional = true }
web-sys = { version = "^0.3", features = ['Worker'], optional = true }
wgpu = { version = "29.0.1", optional = true }
soundkit = { version = "0.11.0", features = ["wasm"], optional = true }
ort = { version = "2.0.0-rc.9", optional = true }
rtrb = { version = "0.3.2", optional = true }

[dev-dependencies]
soundkit = { version = "0.11.0" }

[build-dependencies]
cc = "1.0"

[lib]
crate-type = ["cdylib", "rlib"]

[features]
default = []
wasm = ["web-sys", "wasm-bindgen", "js-sys"]
ort-tensor = ["ort"]
rtrb = ["dep:rtrb"]
cuda = []
wgpu = ["dep:bytemuck", "dep:pollster", "dep:wgpu"]

[profile.release]
codegen-units = 1
lto = true
opt-level = 'z'
