Skip to main content

moq_audio/
error.rs

1/// Errors returned by `moq-audio`.
2#[derive(Debug, thiserror::Error)]
3#[non_exhaustive]
4pub enum AudioError {
5	/// The codec does not support this sample rate / channel combination.
6	#[error("unsupported audio configuration: {0}")]
7	Unsupported(String),
8
9	/// The input buffer was not aligned to the codec's frame size.
10	#[error("input buffer length {got} bytes does not match expected {expected}")]
11	Misaligned { got: usize, expected: usize },
12
13	/// Rubato resampler construction error.
14	#[error("resample construction: {0}")]
15	ResamplerConstruction(#[from] rubato::ResamplerConstructionError),
16
17	/// Rubato resampler runtime error.
18	#[error("resample: {0}")]
19	Resample(#[from] rubato::ResampleError),
20
21	/// hang catalog error.
22	#[error(transparent)]
23	Hang(#[from] hang::Error),
24
25	/// moq-mux container/transport error.
26	#[error(transparent)]
27	Mux(#[from] moq_mux::Error),
28
29	/// moq-net transport error.
30	#[error(transparent)]
31	Moq(#[from] moq_net::Error),
32
33	/// Timestamp overflow.
34	#[error(transparent)]
35	TimeOverflow(#[from] moq_net::TimeOverflow),
36}