pub struct AacEncoder { /* private fields */ }Expand description
AAC-LC encoder (ADTS output). Same interleaved-PCM conventions as
Encoder; one encode call consumes samples_per_frame() (1024)
samples per channel and returns one ADTS frame. flush returns the two
tail frames and must be called at end of stream (encoder delay: 2048
samples; the first frame is a silence priming frame).
Implementations§
Source§impl AacEncoder
impl AacEncoder
Sourcepub fn new(
sample_rate: u32,
channels: u32,
bitrate: u32,
quality: u32,
) -> Result<Self, &'static str>
pub fn new( sample_rate: u32, channels: u32, bitrate: u32, quality: u32, ) -> Result<Self, &'static str>
quality: 0 = speed, 1 = normal (default), 2 = best.
Sourcepub fn with_options(
sample_rate: u32,
channels: u32,
bitrate: u32,
quality: u32,
vbr_quality: Option<u32>,
) -> Result<Self, &'static str>
pub fn with_options( sample_rate: u32, channels: u32, bitrate: u32, quality: u32, vbr_quality: Option<u32>, ) -> Result<Self, &'static str>
Like AacEncoder::new but with vbr_quality Some(0..9) to select
constant-quality VBR (None = CBR at bitrate).
pub fn samples_per_frame(&self) -> usize
pub fn channels(&self) -> usize
Trait Implementations§
Source§impl Drop for AacEncoder
impl Drop for AacEncoder
impl Send for AacEncoder
Auto Trait Implementations§
impl !Sync for AacEncoder
impl Freeze for AacEncoder
impl RefUnwindSafe for AacEncoder
impl Unpin for AacEncoder
impl UnsafeUnpin for AacEncoder
impl UnwindSafe for AacEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more