Skip to main content

WavStreamWriter

Struct WavStreamWriter 

Source
pub struct WavStreamWriter<W> { /* private fields */ }
Expand description

Writer streaming berbasis blok untuk menulis file RIFF WAV secara bertahap.

Implementations§

Source§

impl WavStreamWriter<BufWriter<File>>

Source

pub fn create<P: AsRef<Path>>( path: P, num_channels: u16, sample_rate: u32, options: WavWriteOptions, ) -> Result<Self>

Membuat file WAV baru untuk streaming write.

Source§

impl<W: Write + Seek> WavStreamWriter<W>

Source

pub fn new( writer: W, num_channels: u16, sample_rate: u32, options: WavWriteOptions, ) -> Result<Self>

Inisialisasi streaming writer dan menulis placeholder header 44-byte.

Source

pub fn frames_written(&self) -> usize

Source

pub fn write_block(&mut self, block: &AudioBlock<'_>) -> Result<()>

Menulis blok audio planar ke stream file.

Source

pub fn write_block_frames( &mut self, block: &AudioBlock<'_>, frame_count: usize, ) -> Result<()>

Menulis sejumlah frame_count dari AudioBlock ke stream file.

Source

pub fn write_planar(&mut self, channels: &[&[f32]]) -> Result<()>

Menulis planar slices langsung.

Source

pub fn finalize(self) -> Result<WavHeader>

Menutup stream, menulis ukuran final pada header RIFF dan data chunk, dan melakukan flush.

Auto Trait Implementations§

§

impl<W> Freeze for WavStreamWriter<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for WavStreamWriter<W>
where W: RefUnwindSafe,

§

impl<W> Send for WavStreamWriter<W>
where W: Send,

§

impl<W> Sync for WavStreamWriter<W>
where W: Sync,

§

impl<W> Unpin for WavStreamWriter<W>
where W: Unpin,

§

impl<W> UnsafeUnpin for WavStreamWriter<W>
where W: UnsafeUnpin,

§

impl<W> UnwindSafe for WavStreamWriter<W>
where W: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.