[package]
name = "pocket-tts"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
description = "High-performance CPU-based Text-to-Speech library using Candle"
keywords.workspace = true
categories.workspace = true

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

[features]
default = []
mkl = ["candle-core/mkl", "candle-nn/mkl"]
quantized = []
# WASM is handled by target, not feature flag - candle-core auto-detects wasm32 target
wasm = []
metal = ["candle-core/metal", "candle-nn/metal"]



[dependencies]
candle-core.workspace = true
candle-nn.workspace = true
candle-transformers.workspace = true
safetensors.workspace = true
anyhow.workspace = true
thiserror.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
byteorder.workspace = true
lenient_semver = "0.4.2"
rubato = "0.14.1"
regex = "1"
hound.workspace = true
rand.workspace = true
rand_distr.workspace = true
rayon = "1.11.0"

# Dependencies for non-WASM, non-macOS targets (Linux, Windows)
[target.'cfg(all(not(target_arch = "wasm32"), not(target_os = "macos")))'.dependencies]
hf-hub = { workspace = true, features = ["default-tls", "tokio"] }
intel-mkl-src.workspace = true
memmap2.workspace = true
sentencepiece = "0.13"

# Dependencies for macOS (non-WASM)
[target.'cfg(all(not(target_arch = "wasm32"), target_os = "macos"))'.dependencies]
hf-hub = { workspace = true, features = ["native-tls", "tokio"] }
memmap2.workspace = true
sentencepiece = "0.13"

# WASM-specific dependencies
[target.'cfg(target_arch = "wasm32")'.dependencies]
tokenizers = { workspace = true, features = ["fancy-regex"] }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
js-sys = "0.3"
web-sys = { version = "0.3", features = ["console"] }
getrandom = { version = "0.3", features = ["wasm_js"] }
console_error_panic_hook = "0.1"

[[bench]]
name = "streaming_bench"
harness = false

[dev-dependencies]
criterion = "0.8.1"
candle-core.workspace = true
anyhow.workspace = true
[[bench]]
name = "full_benchmark"
harness = false

[[bench]]
name = "attention_bench"
harness = false
