Skip to main content

decode

Function decode 

Source
pub fn decode(path: &Path) -> Result<Decoded, DecodeError>
Expand description

Decodes the default audio track of a file at its native rate, with every channel kept: the audio track the container flags as default, else the first one with a known codec.

A packet that fails to decode becomes silence and is listed in Decoded::skipped; see MAX_SKIPPED_PACKETS.

ยงErrors

Returns a DecodeError that names the file, what failed and how to fix it: an unreadable file, an unsupported container or codec, a malformed stream or too many corrupt packets, a sample rate outside MIN_SAMPLE_RATE to MAX_SAMPLE_RATE, or a NaN or infinite sample with its offset.