Proteus Library
proteus-lib is the core Rust library behind the Proteus audio tools. It provides:
- Container parsing for
.prot/.mkafiles. - A real-time playback engine and high-level
PlayerAPI. - DSP utilities (convolution reverb and impulse response loading).
- Diagnostics and benchmark helpers (optional feature flags).
Quick Start
use Player;
Structure
container/
- Parses
.prot/.mkacontainers, readsplay_settings.json, and exposes track selections. info.rshandles probe metadata, duration lookup, and full packet scanning.play_settings/models multiple schema versions via serde.
playback/
player.rsis the main public API (Player) that manages state and threads.engine/contains the lower-level mixing engine, buffer management, and reverb worker.
dsp/
convolution.rsprovides FFT-based convolution (complex or real FFT).reverb.rswraps convolution into a reusable per-channel reverb.impulse_response.rsloads and normalizes impulse responses from files or container attachments.
audio/
- Shared ring buffers and sample helpers used by the engine.
diagnostics/
- Optional benchmark utilities and a
Reporterto emit playback status snapshots.
Playback Model (High Level)
- A
Protcontainer resolves track selections and metadata. - Track decoder threads feed per-track ring buffers.
- A mixing thread combines buffers into interleaved audio.
- Optional convolution reverb is applied (if enabled).
- The
Playersends mixed audio to the output sink.
Impulse Responses
Impulse responses can be loaded from:
- a file path (
file:ir.wavor plain path) - a
.prot/.mkaattachment (attachment:ir.wav)
Tail trimming defaults to -60 dB and can be overridden via settings or at runtime.
Feature Flags
bench: enables synthetic DSP benchmarks.real-fft: uses real FFTs for convolution instead of complex FFTs.
Notes
- The library is designed for real-time playback and integrates with the CLI and GUI apps.
- Many settings are driven by the
play_settings.jsonembedded in container files.