pub struct NativeWavEncodeSink { /* private fields */ }Expand description
Transactional PCM WAV writer used by native offline audio export: IEEE float, or integers
converted by alpha2_media::pcm_integer.
Implementations§
Source§impl NativeWavEncodeSink
impl NativeWavEncodeSink
Sourcepub fn create(
path: impl Into<OutputTarget>,
sample_rate: u32,
channels: u16,
) -> Result<Self, EncodeError>
pub fn create( path: impl Into<OutputTarget>, sample_rate: u32, channels: u16, ) -> Result<Self, EncodeError>
Creates a non-overwriting sibling-partial WAV output of channels in the default layout.
§Errors
Returns an error for invalid PCM format, existing paths, or filesystem failures.
Sourcepub fn create_with_speakers(
path: impl Into<OutputTarget>,
sample_rate: u32,
speakers: SpeakerLayout,
) -> Result<Self, EncodeError>
pub fn create_with_speakers( path: impl Into<OutputTarget>, sample_rate: u32, speakers: SpeakerLayout, ) -> Result<Self, EncodeError>
Sourcepub fn create_with_format(
path: impl Into<OutputTarget>,
sample_rate: u32,
speakers: SpeakerLayout,
samples: PcmSampleFormat,
) -> Result<Self, EncodeError>
pub fn create_with_format( path: impl Into<OutputTarget>, sample_rate: u32, speakers: SpeakerLayout, samples: PcmSampleFormat, ) -> Result<Self, EncodeError>
Creates a WAV output of samples whose blocks feed speakers.
The default layout for the count gets a plain header (WAVE_FORMAT_IEEE_FLOAT or
WAVE_FORMAT_PCM); any other is WAVE_FORMAT_EXTENSIBLE with its channel mask and planes
in the mask’s bit order.
§Errors
Returns an error for invalid PCM format, a layout a WAVE channel mask cannot express (unnamed, repeated, or beyond the 18 positions), existing paths, or filesystem failures.
Sourcepub const fn frames_written(&self) -> u64
pub const fn frames_written(&self) -> u64
Samples per channel written so far.
Sourcepub fn publish_report(&self) -> Option<PublishReport>
pub fn publish_report(&self) -> Option<PublishReport>
How the finished file was published; None until it is.
Sourcepub fn seal(&mut self) -> Result<(), EncodeError>
pub fn seal(&mut self) -> Result<(), EncodeError>
Writes the final header and closes the file, which stays a partial file until
Self::publish.
§Errors
When the sink is closed already or the file system refuses.
Sourcepub fn publish(
&mut self,
cancel: &CancelToken,
) -> Result<PublishReport, EncodeError>
pub fn publish( &mut self, cancel: &CancelToken, ) -> Result<PublishReport, EncodeError>
Trait Implementations§
Source§impl AudioBlockSink for NativeWavEncodeSink
impl AudioBlockSink for NativeWavEncodeSink
Source§fn write_audio(
&mut self,
block: &AudioBlock,
cancel: &CancelToken,
) -> Result<(), EncodeError>
fn write_audio( &mut self, block: &AudioBlock, cancel: &CancelToken, ) -> Result<(), EncodeError>
Source§fn finish_audio(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>
fn finish_audio(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>
Source§fn abort_audio(&mut self) -> Result<(), EncodeError>
fn abort_audio(&mut self) -> Result<(), EncodeError>
Source§impl Drop for NativeWavEncodeSink
impl Drop for NativeWavEncodeSink
Source§impl EncodeSink for NativeWavEncodeSink
impl EncodeSink for NativeWavEncodeSink
Source§fn write(
&mut self,
event: EncodeEvent,
cancel: &CancelToken,
) -> Result<(), EncodeError>
fn write( &mut self, event: EncodeEvent, cancel: &CancelToken, ) -> Result<(), EncodeError>
Source§fn finish(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>
fn finish(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>
Auto Trait Implementations§
impl Forget for NativeWavEncodeSink
impl Freeze for NativeWavEncodeSinkwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
I32NotAllOnes: Freeze,
PhantomData<usize>: Freeze,
impl Move for NativeWavEncodeSink
impl RefUnwindSafe for NativeWavEncodeSinkwhere
I32NotAllOnes: RefUnwindSafe,
impl Send for NativeWavEncodeSink
impl Sync for NativeWavEncodeSink
impl Unpin for NativeWavEncodeSink
impl UnsafeUnpin for NativeWavEncodeSinkwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
I32NotAllOnes: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
impl UnwindSafe for NativeWavEncodeSinkwhere
RawVecInner: UnwindSafe,
I32NotAllOnes: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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