Skip to main content

moq_audio/encode/
mod.rs

1//! Encode raw PCM and publish it as a moq audio track.
2//!
3//! The output codec is selected via [`Codec`].
4//!
5//! Entry points, high to low level:
6//! - `publish_capture` captures a microphone (or system audio) and publishes
7//!   it (turnkey). Requires the `capture` feature.
8//! - [`Encoder`] encodes raw PCM you supply into [`Encoded`] packets, and
9//!   [`Producer`] publishes them (bring your own PCM).
10//! - [`Producer`] alone publishes PCM you hand it, encoding as it goes.
11//!
12//! [`Input`] declares the PCM layout going in. [`Config`] configures the
13//! bring-your-own-PCM [`Encoder`], which needs that layout up front; [`Options`]
14//! configures [`Producer`] and `publish_capture`, which learn it from the
15//! caller's frames or the capture source instead. The decode/consume counterpart
16//! lives in the sibling [`decode`](crate::decode) module.
17//!
18//! `publish_capture` is unlinked above because it only exists with the `capture`
19//! feature, so a default-feature rustdoc build has nothing to link to.
20
21mod encoded;
22mod encoder;
23mod producer;
24
25#[cfg(feature = "capture")]
26mod capture;
27
28pub use encoded::Encoded;
29pub use encoder::{Codec, Config, Encoder, Finish, Input};
30pub use producer::{Options, Producer};
31
32#[cfg(feature = "capture")]
33pub use capture::{Driver, Level, Publication, PublicationOptions, State, Status, publish_capture};