Skip to main content

Crate nexcore_audio

Crate nexcore_audio 

Source
Expand description

§NexCore Audio — OS Audio Subsystem

Pure-Rust audio primitives for the NexCore operating system. Provides sample formats, device abstraction, streaming, mixing, and codec support.

§Architecture

┌─────────────────────────────────────────┐
│            Application Layer              │
│  play_sound() │ record() │ set_volume()  │
├─────────────────────────────────────────┤
│              Mixer (Σ)                   │
│  Source combination │ Volume │ Pan │ Solo │
├─────────────────────────────────────────┤
│           Stream Engine (σ)              │
│  Playback/Capture │ Ring Buffer │ State  │
├─────────────────────────────────────────┤
│           Codec Layer (μ)                │
│  S16↔F32 │ Resample │ Channel Remap     │
├─────────────────────────────────────────┤
│          Device Layer (∃)                │
│  Discovery │ Capabilities │ Hot-plug     │
├─────────────────────────────────────────┤
│          Platform (PAL)                  │
│  ALSA │ PulseAudio │ PipeWire │ CoreAudio│
└─────────────────────────────────────────┘

§Primitive Grounding

ComponentPrimitivesRole
Sample typesN + νNumeric audio representation
Ring bufferσ + ∂ + NBounded sequential data
Device model∃ + ς + ΣDevice existence & state
Streamsσ + ς + ∂Stateful bounded flow
MixerΣ + N + ∂Source combination with clipping
Codecsμ + Σ + NFormat mapping between variants

Re-exports§

pub use buffer::AudioBuffer;
pub use codec::CodecId;
pub use codec::ConversionSpec;
pub use codec::ResampleQuality;
pub use device::AudioDevice;
pub use device::DeviceCapabilities;
pub use device::DeviceId;
pub use device::DeviceState;
pub use device::DeviceType;
pub use error::AudioError;
pub use mixer::Mixer;
pub use mixer::MixerSource;
pub use sample::AudioSpec;
pub use sample::ChannelLayout;
pub use sample::SampleFormat;
pub use sample::SampleRate;
pub use stream::AudioStream;
pub use stream::StreamDirection;
pub use stream::StreamId;
pub use stream::StreamState;

Modules§

buffer
Audio ring buffer — lock-free-style circular buffer for streaming.
codec
Audio codec registry — format conversion and encoding.
composites
Composite Types
device
Audio device abstraction — hardware and virtual audio endpoints.
error
Audio subsystem error types.
mixer
Audio mixer — combines multiple audio sources.
prelude
Prelude — nexcore-audio
sample
Audio sample types — formats, rates, and channel layouts.
stream
Audio streams — playback and capture pipelines.