mod backend;
mod config;
mod eager;
mod ops;
#[cfg(feature = "coreml")]
mod compiled;
pub use backend::{SnacBackend, SnacLoadOptions};
pub use config::SnacConfig;
pub use eager::{SAMPLE_RATE, SAMPLES_PER_FRAME, SnacDecoder};
use std::path::PathBuf;
use anyhow::{Result, bail};
pub fn decoder_weights_path() -> Result<PathBuf> {
let path = std::env::var("ORPHEUS_SNAC_PATH")
.ok()
.filter(|p| !p.is_empty())
.map(PathBuf::from)
.ok_or_else(|| {
anyhow::anyhow!(
"ORPHEUS_SNAC_PATH is not set (SNAC weights are not bundled in rlx-orpheus)"
)
})?;
if !path.exists() {
bail!("ORPHEUS_SNAC_PATH does not exist: {}", path.display());
}
Ok(path)
}
pub fn decoder_weights_path_if_available() -> Option<PathBuf> {
let path = std::env::var("ORPHEUS_SNAC_PATH")
.ok()
.filter(|p| !p.is_empty())
.map(PathBuf::from)?;
if path.exists() { Some(path) } else { None }
}