Skip to main content

Module server

Module server 

Source
Expand description

Audio server for full-duplex audio I/O in dev mode.

This module provides an audio server that captures microphone input, processes it through a DevAudioProcessor (typically an FfiProcessor loaded from the user’s cdylib), and sends the processed audio to the output device (speakers/headphones). Meter data is communicated back via a callback channel.

§Architecture

OS Mic → cpal input callback → deinterleave → FfiProcessor::process()
                                                       │
                                             ┌─────────┴──────────┐
                                             │                    │
                                        meter compute      interleave
                                             │               → SPSC ring
                                             ▼                    │
                                       WebSocket broadcast        │
                                                                  ▼
                                             cpal output callback → Speakers

Structs§

AudioConfig
Configuration for audio server.
AudioHandle
Handle returned by AudioServer::start() that keeps both audio streams alive. Drop this handle to stop audio capture and playback.
AudioServer
Audio server that processes OS input through a DevAudioProcessor and routes the processed audio to the output device.