Skip to main content

Module audio

Module audio 

Source
Available on crate features alloc or std only.
Expand description

Audio-stream descriptor vocabulary — channel layout (the name) and channel layout description (the structure: order, mask, per-channel list), sample / container format, bit-rate mode, EBU R128 loudness, fingerprint, embedded metadata tags + cover art. Requires the alloc feature (std includes it) for the Other(SmolStr) escape arms and the Vec<u8> payloads.

Derive threshold. Every open enum here carries Unwrap / TryUnwrap for its Other(SmolStr) arm. The pair generates three methods per variant, so an enum in the hundreds pays that in compile time for one reachable payload arm; the two 200-plus-variant codec enums in codec are the crate’s only exemptions. The line is variant count, not principle. Audio-stream descriptor vocabulary — channel layout (the name) and channel layout description (the structure), sample / container format, bit-rate mode, EBU R128 loudness, ReplayGain normalization, fingerprint, embedded metadata tags + cover art.

Re-exports§

pub use bit_rate_mode::BitRateMode;
pub use channel_layout::ChannelLayout;
pub use channel_layout_description::ChannelLayoutDescription;
pub use channel_order::ChannelOrder;
pub use channel_spec::ChannelSpec;
pub use cover_art::CoverArt;
pub use cover_art::CoverArtError;
pub use fingerprint::Fingerprint;
pub use fingerprint::FingerprintError;
pub use format::ContainerFormat;
pub use format::SampleFormat;
pub use loudness::Loudness;
pub use replay_gain::ReplayGain;
pub use tags::Tags;

Modules§

bit_rate_mode
Audio bit-rate mode — the classic Constant / Variable / Average Bit Rate trichotomy.
channel_layout
Audio channel layout vocabulary — the common named layouts plus an Other(SmolStr) lossless escape for anything outside the closed set.
channel_layout_description
The full structural description of an audio channel layout — order, channel count, mask, per-channel list, and the backend’s rendering.
channel_order
Audio channel order — how a layout’s channels are arranged, mirroring FFmpeg’s AVChannelOrder.
channel_spec
One channel’s entry in a custom-ordered layout — index, backend raw id, and an optional label.
cover_art
Embedded audio cover art — a typed (mime, data) pair carried in ID3v2 APIC frames / MP4 covr atoms / Vorbis METADATA_BLOCK_PICTURE / FLAC PICTURE blocks.
fingerprint
Audio fingerprint — algorithm-tagged raw bytes.
format
Audio sample-format vocabulary (SampleFormat, FFmpeg AVSampleFormat) and audio-only container-format vocabulary (ContainerFormat, audio file extensions).
loudness
EBU R128 / ITU-R BS.1770 loudness measurement: integrated loudness, loudness range, true peak, and sample peak.
replay_gain
ReplayGain — container-tagged loudness-normalization recommendation.
tags
Embedded audio metadata tags — FFmpeg / Vorbis-Comment / iTunes atom-style key-value side data (artist, album, year, genre, …).