Skip to main content

audio_codec/
telephone_event.rs

1use super::{CodecError, Decoder, Encoder, Sample};
2
3pub struct TelephoneEventDecoder {}
4
5impl TelephoneEventDecoder {
6    pub fn new() -> Self {
7        Self {}
8    }
9}
10
11impl Default for TelephoneEventDecoder {
12    fn default() -> Self {
13        Self::new()
14    }
15}
16
17impl Decoder for TelephoneEventDecoder {
18    fn decode_into(&mut self, _data: &[u8], _out: &mut [Sample]) -> Result<usize, CodecError> {
19        Ok(0)
20    }
21
22    fn max_decode_samples(&self, _n_bytes: usize) -> usize {
23        0
24    }
25
26    fn sample_rate(&self) -> u32 {
27        8000
28    }
29
30    fn channels(&self) -> u16 {
31        1
32    }
33}
34
35pub struct TelephoneEventEncoder {}
36
37impl TelephoneEventEncoder {
38    pub fn new() -> Self {
39        Self {}
40    }
41}
42
43impl Default for TelephoneEventEncoder {
44    fn default() -> Self {
45        Self::new()
46    }
47}
48
49impl Encoder for TelephoneEventEncoder {
50    fn encode_into(
51        &mut self,
52        _samples: &[Sample],
53        _out: &mut [u8],
54    ) -> Result<usize, CodecError> {
55        Ok(0)
56    }
57
58    fn max_encode_bytes(&self, _n_samples: usize) -> usize {
59        0
60    }
61
62    fn sample_rate(&self) -> u32 {
63        8000
64    }
65
66    fn channels(&self) -> u16 {
67        1
68    }
69}