pub struct Encoder<'a> { /* private fields */ }
Expand description
- The
Encoder
struct contains all of the encoder types and provides convenient functions that have generic type parameters. - It just translates the API to the inner encoder API.
Implementations§
Source§impl<'a> Encoder<'a>
impl<'a> Encoder<'a>
pub fn new<T>(encoder: T) -> Selfwhere
T: EncoderToImpl + 'a,
pub fn get_channels(&self) -> u16
pub fn get_max_channels(&self) -> u16
pub fn begin_encoding(&mut self) -> Result<(), AudioWriteError>
pub fn new_fmt_chunk(&mut self) -> Result<FmtChunk, AudioWriteError>
pub fn get_bitrate(&self) -> u32
pub fn update_fmt_chunk( &self, fmt: &mut FmtChunk, ) -> Result<(), AudioWriteError>
pub fn finish(&mut self) -> Result<(), AudioWriteError>
Sourcepub fn write_interleaved_samples<S>(
&mut self,
samples: &[S],
) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_interleaved_samples<S>(
&mut self,
samples: &[S],
) -> Result<(), AudioWriteError>where
S: SampleType,
- Write samples regardless of channels
Sourcepub fn write_frame<S>(&mut self, frame: &[S]) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_frame<S>(&mut self, frame: &[S]) -> Result<(), AudioWriteError>where
S: SampleType,
- Write an audio frame, each frame contains one sample for all channels
Sourcepub fn write_frames<S>(
&mut self,
frames: &[Vec<S>],
) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_frames<S>(
&mut self,
frames: &[Vec<S>],
) -> Result<(), AudioWriteError>where
S: SampleType,
- Write audio frames, each frame contains one sample for all channels
Sourcepub fn write_sample<S>(&mut self, mono: S) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_sample<S>(&mut self, mono: S) -> Result<(), AudioWriteError>where
S: SampleType,
- Write only one sample regardless of channels
Sourcepub fn write_mono<S>(&mut self, monos: S) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_mono<S>(&mut self, monos: S) -> Result<(), AudioWriteError>where
S: SampleType,
- Write a single channel of audio to the encoder
Sourcepub fn write_mono_channel<S>(
&mut self,
monos: &[S],
) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_mono_channel<S>(
&mut self,
monos: &[S],
) -> Result<(), AudioWriteError>where
S: SampleType,
- Write a single channel of audio to the encoder
Sourcepub fn write_dual_mono<S>(
&mut self,
mono1: S,
mono2: S,
) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_dual_mono<S>(
&mut self,
mono1: S,
mono2: S,
) -> Result<(), AudioWriteError>where
S: SampleType,
- Write double samples of audio to the encoder
Sourcepub fn write_dual_monos<S>(
&mut self,
mono1: &[S],
mono2: &[S],
) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_dual_monos<S>(
&mut self,
mono1: &[S],
mono2: &[S],
) -> Result<(), AudioWriteError>where
S: SampleType,
- Write double channels of audio to the encoder
Sourcepub fn write_monos<S>(
&mut self,
monos: &[Vec<S>],
) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_monos<S>(
&mut self,
monos: &[Vec<S>],
) -> Result<(), AudioWriteError>where
S: SampleType,
- Write multiple channels of audio to the encoder
Sourcepub fn write_stereo<S>(&mut self, stereo: (S, S)) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_stereo<S>(&mut self, stereo: (S, S)) -> Result<(), AudioWriteError>where
S: SampleType,
- Write only one stereo sample to the encoder
Sourcepub fn write_stereos<S>(
&mut self,
stereos: &[(S, S)],
) -> Result<(), AudioWriteError>where
S: SampleType,
pub fn write_stereos<S>(
&mut self,
stereos: &[(S, S)],
) -> Result<(), AudioWriteError>where
S: SampleType,
- Write stereo samples to the encoder
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Encoder<'a>
impl<'a> !RefUnwindSafe for Encoder<'a>
impl<'a> !Send for Encoder<'a>
impl<'a> !Sync for Encoder<'a>
impl<'a> Unpin for Encoder<'a>
impl<'a> !UnwindSafe for Encoder<'a>
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