pub trait AudioEncoder: Send {
// Required methods
fn encode(&mut self, pcm: &[i16], output: &mut Vec<u8>) -> usize;
fn payload_type(&self) -> u8;
fn codec_type(&self) -> CodecType;
}Expand description
Trait for audio encoders.
Implementations encode PCM audio (signed 16-bit samples) to a compressed format.
Required Methods§
Sourcefn payload_type(&self) -> u8
fn payload_type(&self) -> u8
Get the RTP payload type for this encoder.
Sourcefn codec_type(&self) -> CodecType
fn codec_type(&self) -> CodecType
Get the codec type.