pub struct Mp3Encoder { /* private fields */ }Expand description
Encodes a stream frame by frame.
Implementations§
Source§impl Mp3Encoder
impl Mp3Encoder
pub fn new(cfg: Mp3Config) -> Result<Self, Mp3Error>
pub fn config(&self) -> &Mp3Config
Sourcepub fn push(&mut self, planar: &[&[f32]]) -> Result<Vec<u8>, Mp3Error>
pub fn push(&mut self, planar: &[&[f32]]) -> Result<Vec<u8>, Mp3Error>
Adds samples (one slice per channel, equal lengths) and returns the bytes of every frame that is now complete.
Sourcepub fn finish(&mut self) -> Vec<u8> ⓘ
pub fn finish(&mut self) -> Vec<u8> ⓘ
Ends the stream: pads with silence so the last samples and the delay behind them come out.
Sourcepub fn info_frame(&self) -> Vec<u8> ⓘ
pub fn info_frame(&self) -> Vec<u8> ⓘ
The Info frame that goes first in the file, once everything has been
encoded: it carries the length, the encoder delay and the padding.
Auto Trait Implementations§
impl Forget for Mp3Encoder
impl Freeze for Mp3Encoder
impl Move for Mp3Encoder
impl RefUnwindSafe for Mp3Encoder
impl Send for Mp3Encoder
impl Sync for Mp3Encoder
impl Unpin for Mp3Encoder
impl UnsafeUnpin for Mp3Encoder
impl UnwindSafe for Mp3Encoder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more