Skip to main content

NativeWavEncodeSink

Struct NativeWavEncodeSink 

Source
pub struct NativeWavEncodeSink { /* private fields */ }
Expand description

Transactional IEEE-f32 WAV encoder used by native offline audio export.

Implementations§

Source§

impl NativeWavEncodeSink

Source

pub fn create( path: impl AsRef<Path>, sample_rate: u32, channels: u16, ) -> Result<Self, EncodeError>

Creates a non-overwriting sibling-partial WAV output of channels in the count’s default layout.

§Errors

Returns an error for invalid PCM format, existing paths, or filesystem failures.

Source

pub fn create_with_speakers( path: impl AsRef<Path>, sample_rate: u32, speakers: SpeakerLayout, ) -> Result<Self, EncodeError>

Creates a WAV output whose blocks feed speakers.

The count’s default layout gets a plain header, which every reader takes as that layout. Any other is written as WAVE_FORMAT_EXTENSIBLE with its channel mask, the planes in the mask’s bit order, which WAVE requires.

§Errors

Returns an error for invalid PCM format, a layout a WAVE channel mask cannot say (an unnamed or repeated speaker, or one past the 18 WAVE positions), existing paths, or filesystem failures.

Trait Implementations§

Source§

impl AudioBlockSink for NativeWavEncodeSink

Source§

fn write_audio( &mut self, block: &AudioBlock, cancel: &CancelToken, ) -> Result<(), EncodeError>

Writes one monotonic audio block. Read more
Source§

fn finish_audio(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>

Drains and commits the sink. Read more
Source§

fn abort_audio(&mut self) -> Result<(), EncodeError>

Discards partial output. Read more
Source§

impl Drop for NativeWavEncodeSink

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl EncodeSink for NativeWavEncodeSink

Source§

fn write( &mut self, event: EncodeEvent, cancel: &CancelToken, ) -> Result<(), EncodeError>

Queues one timestamped media item. Read more
Source§

fn finish(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>

Drains encoder delay, interleaves remaining packets, and writes the trailer. Read more
Source§

fn abort(&mut self) -> Result<(), EncodeError>

Aborts and applies the adapter’s partial-output cleanup policy. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,