auxide-io 0.1.0

Real-time safe audio I/O layer for auxide DSP graphs using CPAL
Documentation

Crates.io Documentation CI License: MIT

Auxide IO

Real-time audio I/O layer for Auxide.
Stream Auxide's audio graphs to speakers with CPAL, featuring buffer size adaptation, channel routing, and RT-safe operation.

The Auxide Audio Stack

Auxide IO is the output layer of the Auxide audio ecosystem:

  • Auxide: RT-safe DSP graph kernel
  • Auxide IO (this crate): Hardware audio streaming and I/O

Together, they provide a complete solution for real-time audio synthesis and processing in Rust.

🔗 Get Auxide Core | Crate | Docs

What is Auxide IO?

Auxide IO bridges the gap between Auxide's deterministic kernel and real-world audio output. It provides:

  • CPAL Integration: Cross-platform audio I/O via CPAL.
  • Buffer Adaptation: Handles mismatched buffer sizes between Auxide (fixed) and host (variable).
  • Channel Routing: Mono-to-stereo duplication, future multi-channel support.
  • RT Safety: No allocations, locks, or I/O in audio callbacks.
  • Error Recovery: Graceful handling of stream errors with silence fallback.

Why Auxide IO?

Auxide handles the DSP graph; Auxide IO handles the hardware. Together, they form a complete audio synthesis stack.

Feature Auxide IO CPAL Rodio SDL2 Audio
RT-Safe
Buffer Adaptation
Channel Routing
Auxide Integration
Cross-Platform

Governance

Auxide IO is open source but not open contribution. The project is maintained by @Michael-A-Kuykendall; unsolicited PRs are closed by default. See CONTRIBUTING.md and GOVERNANCE.md for the collaboration policy.

Usage

Auxide IO requires Auxide for the DSP graph. Add both to your Cargo.toml:

[dependencies]

auxide = "0.1"

auxide-io = "0.1"

Basic playback:

use auxide::graph::{Graph, NodeType, PortId, Rate};
use auxide::plan::Plan;
use auxide::rt::Runtime;
use auxide_io::StreamController;

fn main() -> anyhow::Result<()> {
    // Build a sine wave graph
    let mut graph = Graph::new();
    let osc = graph.add_node(NodeType::SineOsc { freq: 440.0 });
    let sink = graph.add_node(NodeType::OutputSink);
    graph.add_edge(auxide::graph::Edge {
        from_node: osc,
        from_port: PortId(0),
        to_node: sink,
        to_port: PortId(0),
        rate: Rate::Audio,
    })?;

    let plan = Plan::compile(&graph, 512)?;
    let runtime = Runtime::new(plan, &graph, 44100.0);

    // Play it
    let controller = StreamController::play(runtime)?;
    controller.start()?;
    // Audio plays...
    controller.stop();

    Ok(())
}

Architecture

Auxide IO's components:

  • StreamController: Manages CPAL streams, state, and lifecycle.
  • BufferSizeAdapter: Ring buffer for size mismatches.
  • ChannelRouter: Mono-to-stereo conversion.
  • StreamState: Atomic state management for RT communication.
  • ErrorRecovery: Silent failure on errors.

All operations are RT-safe: fixed-size buffers, atomic ops, no heap allocation in callbacks.

Contributing

See CONTRIBUTING.md. Auxide IO follows the same rules as Auxide: high standards, RT safety first.

Learn More

  • Auxide Core: Build complex DSP graphs, custom nodes, and audio processing chains
  • Examples: Check examples/ for playback demos
  • Documentation: Full API docs on docs.rs

License

MIT License. See LICENSE.

Sponsors

See SPONSORS.md.