pub enum SwAudioEncoderError {
CodecNotFound(String),
UnsupportedBuffer(&'static str),
NoF32Format(String, Vec<Sample>),
UnsupportedSampleRate(String, u32, Vec<u32>),
Ffmpeg(Error),
}Expand description
Errors specific to SwAudioEncoder. Converts into the crate-wide
Error via ? (see crate::error::Error).
Variants§
CodecNotFound(String)
The requested encoder is unavailable in the linked FFmpeg build.
UnsupportedBuffer(&'static str)
The sink received a buffer other than decoded audio or end-of-stream.
NoF32Format(String, Vec<Sample>)
SwAudioEncoder only ever resamples to Sample::F32 (packed or
planar, whichever the codec itself reports) — see its own docs on
why. This is what a codec whose only supported formats are
something else entirely (integer PCM, f64, …) gets instead of
a silently-wrong guess. Neither codec this crate opens today
(aac, libopus) hits this.
UnsupportedSampleRate(String, u32, Vec<u32>)
The codec publishes a fixed list of sample rates and
SwAudioEncoderOptions::sample_rate is not on it — libopus
takes only 48/24/16/12/8 kHz, for example. Caught here because
avcodec_open2 reports it as a bare Invalid argument that names
neither the rate nor the alternatives.
Ffmpeg(Error)
FFmpeg rejected encoder, resampler, frame, or packet processing.
Trait Implementations§
Source§impl Debug for SwAudioEncoderError
impl Debug for SwAudioEncoderError
Source§impl Display for SwAudioEncoderError
impl Display for SwAudioEncoderError
Source§impl Error for SwAudioEncoderError
impl Error for SwAudioEncoderError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()