sendspin-rs
=======
[!WARNING]
THIS IS A WIP. Please help!
Hyper-efficient Rust implementation of the Sendspin Protocol for synchronized multi-room audio streaming.
Features
- Zero-copy audio pipeline - Minimal allocations, maximum performance
- Lock-free concurrency - No contention on audio thread
- Async I/O - Efficient WebSocket handling with Tokio
- Type-safe protocol - Leverage Rust's type system for correctness
Performance Targets
- Audio latency: <10ms end-to-end jitter
- CPU usage: <2% on modern hardware (4-core)
- Memory: <20MB stable
- Thread synchronization: Lock-free audio pipeline
Current Status
Phase 1: Foundation ✅ (Complete)
- Core audio types (Sample, AudioFormat, AudioBuffer)
- Protocol message types with serde serialization
- WebSocket client with handshake
- PCM decoder (16-bit and 24-bit)
- Clock synchronization (NTP-style)
Phase 2: Audio Pipeline 🚧 (Next)
- Audio output (cpal integration)
- Lock-free scheduler
- End-to-end player
Quick Start
Add to your Cargo.toml:
[]
= "0.1"
Basic Client Example
use ;
use ProtocolClient;
async
See examples/ directory for more examples.
Architecture
See docs/rust-thoughts.md for detailed architecture and implementation notes.
Development
# Build
# Run tests
# Run examples
# Build with optimizations
Verification (cargo-make)
# Install cargo-make (one time)
# Run the full verification suite
cargo make verify runs: tests, Clippy, doc build, doctests, and formatting checks.
Testing
# Run all tests
# Run specific test
# Run with logging
RUST_LOG=debug
License
MIT OR Apache-2.0
Contributing
Contributions welcome! Please open an issue or PR.