Skip to main content

Module encode

Module encode 

Source
Expand description

Encode raw PCM and publish it as a moq audio track.

The output codec is selected via Codec.

Entry points, high to low level:

  • publish_capture captures a microphone (or system audio) and publishes it (turnkey). Requires the capture feature.
  • Encoder encodes raw PCM you supply, and Producer publishes the resulting packets (bring your own PCM).
  • Producer alone publishes PCM you hand it, encoding as it goes.

Input declares the PCM layout going in. Config configures the bring-your-own-PCM Encoder, which needs that layout up front; Options configures Producer and publish_capture, which learn it from the caller’s frames or the capture source instead. The decode/consume counterpart lives in the sibling decode module.

publish_capture is unlinked above because it only exists with the capture feature, so a default-feature rustdoc build has nothing to link to.

Structs§

Config
Encoder configuration: the input PCM layout plus the codec knobs.
Encoder
Audio encoder over the PCM layout declared in Config::input.
Input
The PCM layout of the buffers handed to Encoder::encode / Producer::write.
Options
Source-agnostic encode knobs for Producer and publish_capture, where the input PCM layout comes from the caller’s frames or the capture source rather than from these options. For the bring-your-own-PCM Encoder, which needs that layout up front, use Config instead.
Producer
Encode raw PCM and publish it as a moq-mux audio track.

Enums§

Codec
Output audio codec. #[non_exhaustive] so new codecs can be added without breaking external matches.