Struct ac_ffmpeg::codec::audio::AudioEncoder
source · pub struct AudioEncoder { /* private fields */ }
Expand description
Audio encoder.
Implementations§
source§impl AudioEncoder
impl AudioEncoder
sourcepub fn from_codec_parameters(
codec_parameters: &AudioCodecParameters
) -> Result<AudioEncoderBuilder, Error>
pub fn from_codec_parameters(
codec_parameters: &AudioCodecParameters
) -> Result<AudioEncoderBuilder, Error>
Create a new encoder builder from given codec parameters.
sourcepub fn builder(codec: &str) -> Result<AudioEncoderBuilder, Error>
pub fn builder(codec: &str) -> Result<AudioEncoderBuilder, Error>
Get encoder builder for a given codec.
sourcepub fn samples_per_frame(&self) -> Option<usize>
pub fn samples_per_frame(&self) -> Option<usize>
Number of samples per audio channel in an audio frame. Each encoded frame except the last one must contain exactly this number of samples. The method returns None if the number of samples per frame is not restricted.
Trait Implementations§
source§impl Encoder for AudioEncoder
impl Encoder for AudioEncoder
type CodecParameters = AudioCodecParameters
type Frame = AudioFrame
source§fn codec_parameters(&self) -> Self::CodecParameters
fn codec_parameters(&self) -> Self::CodecParameters
Get codec parameters.
source§fn try_push(&mut self, frame: AudioFrame) -> Result<(), CodecError>
fn try_push(&mut self, frame: AudioFrame) -> Result<(), CodecError>
Push a given frame to the encoder.