Skip to main content

Crate moq_audio

Crate moq_audio 

Source
Expand description

Native audio encoding and decoding for Media over QUIC.

Sits on top of moq_mux and hang and adds the missing piece for native callers: a Rust-native Opus codec implementation that turns raw PCM into the bitstreams moq_mux::codec::opus already knows how to ingest (and vice versa for decode).

Re-exports§

pub use consumer::AudioConsumer;
pub use producer::AudioProducer;

Modules§

consumer
Subscribe to an encoded audio track and emit raw PCM.
producer
Publish raw PCM as encoded audio in a moq broadcast.

Structs§

Decoder
Opus decoder producing interleaved f32 PCM.
DecoderOutput
PCM layout the caller wants out of Decoder::decode_f32 / AudioConsumer::read. sample_rate and channels None means “match the codec’s native shape from the catalog”.
Encoder
Opus encoder over the PCM layout declared in EncoderInput.
EncoderInput
PCM layout the caller hands to Encoder::encode_f32 / AudioProducer::write.
EncoderOutput
Codec-side configuration. sample_rate and channels are optional overrides; None means “match input (snapping the rate up to a libopus-supported value if necessary)”.
Frame
One unit of audio passed across the codec boundary.
Resampler
Sample-rate converter over interleaved f32 PCM.

Enums§

AudioError
Errors returned by moq-audio.
AudioFormat
Raw PCM sample format.
Codec
Codec identifier. Opus is the only variant today; AAC may follow.

Functions§

pick_opus_rate
Snap an arbitrary sample rate up to the nearest libopus-supported rate (8/12/16/24/48 kHz); falls back to 48 kHz for anything above.