Skip to main content

Module audio

Module audio 

Source
Expand description

Audio decoding: the one path playback, seeking, durations, waveforms and the tempo all read audio through.

open returns an AudioSource, a stream of interleaved f32 blocks that can seek. The main backend is symphonia (pure Rust, MPL-2.0) with its MP3, AAC, ALAC, FLAC, Vorbis, PCM and ADPCM decoders in MP4/M4A, Ogg, WAV, FLAC, MP3 and ADTS files, plus the pure-Rust opus-decoder crate for Opus (in Ogg or M4A, which Eagle’s Chromium player also plays). A file that doesn’t decode returns an AudioError and callers fall back (the viewer shows the reason, the waveform is flat, no duration is stored). When an LGPL FFmpeg is installed (falcon-ffmpeg, loaded at run time), open tries it after symphonia, which covers the soundtracks of video files.

Structs§

Block
Decoded audio: interleaved samples in -1..=1, never empty.
FfmpegSource
A file’s sound decoded by FFmpeg, as stereo f32 at 48 kHz.
SymphoniaSource
A file decoded by symphonia.

Enums§

AudioError
Why a file can’t be decoded.

Constants§

DECODED
Audio formats that decode, by extension, with the codecs each may hold.

Traits§

AudioSource
A decoded audio stream.

Functions§

open
Opens an audio file (ext is a hint; the contents decide). Backends are tried in turn; the first error is kept when none can.