1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/// Errors returned by `moq-audio`.
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
/// The requested configuration is outside what the codec supports, e.g. a
/// sample rate, channel count, or frame duration Opus can't encode. The
/// caller asked for something impossible; picking different settings fixes it.
#[error("unsupported audio configuration: {0}")]
Unsupported(String),
/// No audio device matched the requested selector, or the machine has no
/// default input. Retrying won't help until the device list changes;
/// `capture::devices` reports what is available.
#[error("audio device: {0}")]
Device(String),
/// The capture backend failed or delivered nothing: a denied permission, a
/// device that stopped mid-stream, or a host API error. The configuration may
/// be fine; the device or its permissions are not.
#[error("audio capture: {0}")]
Capture(String),
/// The playback backend failed: the output device could not be opened, or the
/// stream stopped and could not be restarted. The device or host API is at
/// fault, not the configuration; `playback::devices` reports what is
/// available.
#[error("audio playback: {0}")]
Playback(String),
/// The input buffer was not aligned to the codec's frame size.
#[error("input buffer length {got} bytes does not match expected {expected}")]
Misaligned {
/// The buffer length received, in bytes.
got: usize,
/// The buffer length required, in bytes.
expected: usize,
},
/// Rubato resampler construction error.
#[error("resample construction: {0}")]
ResamplerConstruction(#[from] rubato::ResamplerConstructionError),
/// Rubato resampler runtime error.
#[error("resample: {0}")]
Resample(#[from] rubato::ResampleError),
/// hang catalog error.
#[error(transparent)]
Hang(#[from] hang::Error),
/// moq-mux container/transport error.
#[error(transparent)]
Mux(#[from] moq_mux::Error),
/// moq-net transport error.
#[error(transparent)]
Net(#[from] moq_net::Error),
/// Timestamp overflow.
#[error(transparent)]
TimeOverflow(#[from] moq_net::TimeOverflow),
}