pub enum NativeAudioFileSink {
Wav(Box<NativeWavEncodeSink>),
Encoded(Box<NativeAudioEncodeSink>),
}Expand description
A transactional audio-only output of either kind.
Variants§
Wav(Box<NativeWavEncodeSink>)
PCM in a WAVE file.
Encoded(Box<NativeAudioEncodeSink>)
One encoded stream in its container.
Implementations§
Source§impl NativeAudioFileSink
impl NativeAudioFileSink
Sourcepub fn create(
path: impl Into<OutputTarget>,
config: AudioFileConfig,
) -> Result<Self, EncodeError>
pub fn create( path: impl Into<OutputTarget>, config: AudioFileConfig, ) -> Result<Self, EncodeError>
Creates the output config describes without touching the destination.
§Errors
For PCM outside a WAVE file or an encoded codec in one, a layout an encoder does not
take, and as NativeWavEncodeSink::create_with_format and
NativeAudioEncodeSink::create.
Sourcepub fn encoder_name(&self) -> Option<&str>
pub fn encoder_name(&self) -> Option<&str>
The FFmpeg name of the encoder; None for PCM, which has none.
Sourcepub fn frames_written(&self) -> u64
pub fn frames_written(&self) -> u64
Project-rate samples per channel taken so far.
Sourcepub fn seal(&mut self) -> Result<(), EncodeError>
pub fn seal(&mut self) -> Result<(), EncodeError>
Completes and closes the file, which stays a partial file until Self::publish, so
several outputs of one export can all be whole before any is moved into place.
§Errors
When the encoder, the muxer 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 NativeAudioFileSink
impl AudioBlockSink for NativeAudioFileSink
Source§fn write_audio(
&mut self,
block: &AudioBlock,
cancel: &CancelToken,
) -> Result<(), EncodeError>
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>
fn finish_audio(&mut self, cancel: &CancelToken) -> Result<(), EncodeError>
Drains and commits the sink. Read more
Source§fn abort_audio(&mut self) -> Result<(), EncodeError>
fn abort_audio(&mut self) -> Result<(), EncodeError>
Discards partial output. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for NativeAudioFileSink
impl !Sync for NativeAudioFileSink
impl !UnwindSafe for NativeAudioFileSink
impl Forget for NativeAudioFileSink
impl Freeze for NativeAudioFileSinkwhere
*const NativeWavEncodeSink is !null: Freeze,
PhantomData<NativeWavEncodeSink>: Freeze,
*const NativeAudioEncodeSink is !null: Freeze,
PhantomData<NativeAudioEncodeSink>: Freeze,
impl Move for NativeAudioFileSink
impl Send for NativeAudioFileSink
impl Unpin for NativeAudioFileSink
impl UnsafeUnpin for NativeAudioFileSinkwhere
*const NativeWavEncodeSink is !null: UnsafeUnpin,
PhantomData<NativeWavEncodeSink>: UnsafeUnpin,
*const NativeAudioEncodeSink is !null: UnsafeUnpin,
PhantomData<NativeAudioEncodeSink>: UnsafeUnpin,
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
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> ⓘ
Converts
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> ⓘ
Converts
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