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`], and the implementation behind it
4//! via [`Kind`]: a platform encoder when the host has one, software otherwise.
5//! AAC has no software encoder, so a host without a platform one refuses it.
6//!
7//! Entry points, high to low level:
8//! - `publish_capture` captures a microphone (or system audio) and publishes
9//!   it (turnkey). Requires the `capture` feature.
10//! - [`Encoder`] encodes raw PCM you supply into [`Encoded`] packets, and
11//!   [`Producer`] publishes them (bring your own PCM).
12//! - [`Producer`] alone publishes PCM you hand it, encoding as it goes.
13//!
14//! [`Input`] declares the source PCM while [`Settings`] describes exactly what
15//! the codec accepts. [`Options`] combines those settings with publication policy.
16//!
17//! `publish_capture` is unlinked above because it only exists with the `capture`
18//! feature, so a default-feature rustdoc build has nothing to link to.
19
20mod backend;
21mod encoded;
22mod encoder;
23mod producer;
24
25#[cfg(feature = "capture")]
26mod capture;
27
28pub use encoded::Encoded;
29pub use encoder::{Codec, Encoder, Finish, Input, Kind, Settings};
30pub use producer::{Options, Producer};
31
32#[cfg(feature = "capture")]
33pub use capture::{Driver, Level, Publication, PublicationOptions, State, Status, publish_capture};