audio-codec-bsd 0.1.1

FLAC/PCM/WAV multi-format audio container decoder (symphonia + hound, pure Rust) emitting planar audio-core-bsd AudioFrames
Documentation
//! A multi-format audio container decoder (FLAC / PCM / WAV).
//!
//! This crate decodes FLAC, PCM, and WAV containers into planar
//! [`audio_core_bsd::AudioFrame`]s on a **worker thread**. It is deliberately
//! **not** real-time safe: implementations are expected to perform file I/O
//! and heap allocation freely. Decoded frames are handed to a lock-free ring
//! buffer or similar channel so the RT audio thread never touches this crate.
//!
//! ## Supported formats
//!
//! - **FLAC** — lossless, decoded via [`SymphoniaDecoder`] (symphonia 0.6).
//! - **WAV** — PCM/IEEE-float RIFF, decoded via [`WavDecoder`] (hound).
//! - **PCM** — raw headerless little-endian samples (planned).
//!
//! Use [`open`] for magic-byte auto-detection, or construct a concrete
//! decoder directly when the container is known ahead of time.
//!
//! ## Dependency licensing
//!
//! This crate depends on [`symphonia`] (**MPL-2.0**, pure Rust) and
//! [`hound`] (**Apache-2.0/MIT**, pure Rust). MPL-2.0 permits static/dynamic
//! linking from a BSD-2-Clause crate without copyleft contamination,
//! provided that any *modified* symphonia source files are republished under
//! MPL-2.0. Unmodified use (the default) imposes only a notice obligation.
//! Because MPL-2.0 is file-level, any forked/modified symphonia files must
//! carry the MPL header and be disclosed.
//!
//! [`symphonia`]: https://crates.io/crates/symphonia
//! [`hound`]: https://crates.io/crates/hound
//!
//! # Example
//!
//! Open a container by magic-byte sniffing and drain it frame-by-frame into
//! planar [`audio_core_bsd::AudioFrame`]s:
//!
//! ```rust,no_run
//! use audio_codec_bsd::open;
//! use std::path::Path;
//!
//! let mut dec = open(Path::new("song.flac"))?;
//! let info = dec.open(Path::new("song.flac"))?;
//! while let Some(_frame) = dec.next_frame()? {
//!     // push _frame into a lock-free ring for the RT thread.
//! }
//! # let _ = info;
//! # Ok::<(), audio_codec_bsd::CodecError>(())
//! ```

#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs)]
#![warn(clippy::all, clippy::pedantic)]

pub mod decoder;
pub mod error;
pub mod format;
pub mod symphonia_impl;
pub mod wav;

pub use decoder::{ContainerDecoder, FormatKind, StreamInfo};
pub use error::{CodecError, Result};
pub use format::open;
pub use symphonia_impl::SymphoniaDecoder;
pub use wav::WavDecoder;