pub struct VorbisEncoder { /* private fields */ }Expand description
Vorbis audio encoder.
Implementations§
Source§impl VorbisEncoder
impl VorbisEncoder
Sourcepub fn new(config: VorbisConfig) -> CodecResult<Self>
pub fn new(config: VorbisConfig) -> CodecResult<Self>
Create a new encoder from config.
§Errors
Returns CodecError::InvalidParameter if the configuration is invalid.
Sourcepub fn headers(&mut self) -> Vec<VorbisPacket>
pub fn headers(&mut self) -> Vec<VorbisPacket>
Return the three mandatory Vorbis header packets.
Must be called before any audio encoding.
Sourcepub fn encode_interleaved(
&mut self,
samples: &[f32],
) -> CodecResult<Vec<VorbisPacket>>
pub fn encode_interleaved( &mut self, samples: &[f32], ) -> CodecResult<Vec<VorbisPacket>>
Encode interleaved PCM samples (f32, range [-1, +1]).
Returns zero or more audio packets. Call flush() at end-of-stream.
§Errors
Returns CodecError::InvalidParameter if the sample count is not a
multiple of channels.
Sourcepub fn flush(&mut self) -> CodecResult<Vec<VorbisPacket>>
pub fn flush(&mut self) -> CodecResult<Vec<VorbisPacket>>
Flush any remaining buffered samples as a final packet.
Auto Trait Implementations§
impl Freeze for VorbisEncoder
impl RefUnwindSafe for VorbisEncoder
impl Send for VorbisEncoder
impl Sync for VorbisEncoder
impl Unpin for VorbisEncoder
impl UnsafeUnpin for VorbisEncoder
impl UnwindSafe for VorbisEncoder
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