Struct creek_encode_wav::WavEncoder
source · pub struct WavEncoder<B: WavBitDepth + 'static> { /* private fields */ }
Trait Implementations§
source§impl<B: WavBitDepth + 'static> Encoder for WavEncoder<B>
impl<B: WavBitDepth + 'static> Encoder for WavEncoder<B>
§type T = <B as WavBitDepth>::T
type T = <B as WavBitDepth>::T
The data type of a single sample. (i.e.
f32
)§type AdditionalOpts = ()
type AdditionalOpts = ()
Any additional options for creating a file with this encoder.
§type FileParams = Params
type FileParams = Params
Any additional information on the file.
§type OpenError = WavOpenError
type OpenError = WavOpenError
The error type while opening the file.
§type FatalError = WavFatalError
type FatalError = WavFatalError
The error type when a fatal error occurs.
source§const DEFAULT_BLOCK_SIZE: usize = 32_768usize
const DEFAULT_BLOCK_SIZE: usize = 32_768usize
The default number of frames in a write block.
source§const DEFAULT_NUM_WRITE_BLOCKS: usize = 8usize
const DEFAULT_NUM_WRITE_BLOCKS: usize = 8usize
The default number of write blocks. This must be sufficiently large to
ensure there are enough write blocks for the client in the worst case
write latency scenerio.
source§fn new(
path: PathBuf,
num_channels: u16,
sample_rate: u32,
block_size: usize,
_num_write_blocks: usize,
_additional_opts: Self::AdditionalOpts
) -> Result<(Self, FileInfo<Self::FileParams>), Self::OpenError>
fn new( path: PathBuf, num_channels: u16, sample_rate: u32, block_size: usize, _num_write_blocks: usize, _additional_opts: Self::AdditionalOpts ) -> Result<(Self, FileInfo<Self::FileParams>), Self::OpenError>
Open the file for writing. Read more
source§fn encode(
&mut self,
write_block: &WriteBlock<Self::T>
) -> Result<WriteStatus, Self::FatalError>
fn encode( &mut self, write_block: &WriteBlock<Self::T> ) -> Result<WriteStatus, Self::FatalError>
Write a block of data to the file. Read more
source§fn finish_file(&mut self) -> Result<(), Self::FatalError>
fn finish_file(&mut self) -> Result<(), Self::FatalError>
Finish up the file and then close it.
source§fn discard_file(&mut self) -> Result<(), Self::FatalError>
fn discard_file(&mut self) -> Result<(), Self::FatalError>
Delete all created files. Do not start over.
source§fn discard_and_restart(&mut self) -> Result<(), Self::FatalError>
fn discard_and_restart(&mut self) -> Result<(), Self::FatalError>
Delete all created files and start over from the beginning.
Auto Trait Implementations§
impl<B> RefUnwindSafe for WavEncoder<B>
impl<B> Send for WavEncoder<B>where
B: Send,
impl<B> Sync for WavEncoder<B>
impl<B> Unpin for WavEncoder<B>
impl<B> UnwindSafe for WavEncoder<B>
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