pub struct WavDemuxer { /* private fields */ }Expand description
WAV demuxer.
Beyond the Demuxer trait, this type exposes round-77 accessors
for the WAVEFORMATEXTENSIBLE side-info — format_tag,
valid_bits_per_sample, channel_mask, subformat. Callers that
only have a Box<dyn Demuxer> should rely on the wav:fmt.*
metadata keys instead.
Implementations§
Source§impl WavDemuxer
impl WavDemuxer
Sourcepub fn format_tag(&self) -> u16
pub fn format_tag(&self) -> u16
On-wire wFormatTag from the fmt chunk (one of WAVE_FORMAT_*).
Preserved verbatim for round-trip purposes — the codec id
already encodes the decoder dispatch.
Sourcepub fn valid_bits_per_sample(&self) -> Option<u16>
pub fn valid_bits_per_sample(&self) -> Option<u16>
WAVEFORMATEXTENSIBLE.Samples.wValidBitsPerSample — actual bit
precision per sample. None for legacy WAVEFORMATEX streams
(non-EXTENSIBLE wFormatTag).
Sourcepub fn channel_mask(&self) -> Option<u32>
pub fn channel_mask(&self) -> Option<u32>
WAVEFORMATEXTENSIBLE.dwChannelMask — SPEAKER_* bitmap
describing the channel ordering of the interleaved PCM byte
stream. None for non-EXTENSIBLE streams.
See docs/container/riff/waveformatextensible/README.md
§“dwChannelMask bits” for the standard layouts.
Sourcepub fn channel_layout(&self) -> Option<String>
pub fn channel_layout(&self) -> Option<String>
Human-readable speaker layout decoded from
Self::channel_mask — a +-separated list of SPEAKER_*
positions in canonical least-significant-bit-first order
(e.g. "FRONT_LEFT+FRONT_RIGHT+FRONT_CENTER+LOW_FREQUENCY").
None when the stream is non-EXTENSIBLE, or when the mask is 0
(no assigned speaker positions). The same value is mirrored under
the wav:fmt.channel_layout metadata key for dyn Demuxer
consumers. See
docs/container/riff/waveformatextensible/ms-waveformatextensible.html.
Sourcepub fn subformat(&self) -> Option<&[u8; 16]>
pub fn subformat(&self) -> Option<&[u8; 16]>
WAVEFORMATEXTENSIBLE.SubFormat — 16-byte GUID (the actual
codec identifier when format_tag == WAVE_FORMAT_EXTENSIBLE).
Returned in on-wire byte order (first three groups
little-endian, trailing two groups big-endian); use
Self::subformat_text for the canonical text representation.
Sourcepub fn subformat_text(&self) -> Option<String>
pub fn subformat_text(&self) -> Option<String>
WAVEFORMATEXTENSIBLE.SubFormat formatted as a canonical
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX GUID string.
Trait Implementations§
Source§impl Demuxer for WavDemuxer
impl Demuxer for WavDemuxer
Source§fn format_name(&self) -> &str
fn format_name(&self) -> &str
"wav").Source§fn streams(&self) -> &[StreamInfo]
fn streams(&self) -> &[StreamInfo]
Source§fn next_packet(&mut self) -> Result<Packet>
fn next_packet(&mut self) -> Result<Packet>
Error::Eof at end.Source§fn seek_to(&mut self, stream_index: u32, pts: i64) -> Result<i64>
fn seek_to(&mut self, stream_index: u32, pts: i64) -> Result<i64>
pts (in the given
stream’s time base). Returns the actual timestamp seeked to, or
Error::Unsupported if this demuxer can’t seek.Source§fn metadata(&self) -> &[(String, String)]
fn metadata(&self) -> &[(String, String)]
title, artist, album, comment, date, sample_name:<n>,
channels, n_patterns, etc. Demuxers that carry no metadata
return an empty slice (the default).Source§fn duration_micros(&self) -> Option<i64>
fn duration_micros(&self) -> Option<i64>
None — callers
may fall back to the longest per-stream duration. Expressed as
microseconds for portability; convert to seconds at the edge.Source§fn set_active_streams(&mut self, _indices: &[u32])
fn set_active_streams(&mut self, _indices: &[u32])
Source§fn attached_pictures(&self) -> &[AttachedPicture]
fn attached_pictures(&self) -> &[AttachedPicture]
METADATA_BLOCK_PICTURE on FLAC, covr
atoms on MP4, etc. — override this to expose the images.Source§fn chapters(&self) -> &[Chapter]
fn chapters(&self) -> &[Chapter]
Chapters,
MP4 chapter track, Ogg CHAPTERnn= Vorbis comments, …) should
override and return Chapter records in
presentation order. Coexists with the legacy chapter:N:*
flat-metadata keys; new consumers should prefer this.Source§fn attachments(&self) -> &[Attachment]
fn attachments(&self) -> &[Attachment]
Attachments,
…) should override and return Attachment
records in container order. Coexists with the legacy
attachment:N:* flat-metadata keys; new consumers should prefer
this.