pub struct AudioOutput { /* private fields */ }Expand description
Accumulating state for the audio_chunk event stream.
Implementations§
Source§impl AudioOutput
impl AudioOutput
Sourcepub fn wav(path: &Path) -> Result<Self, FttsError>
pub fn wav(path: &Path) -> Result<Self, FttsError>
Open a WAV file sink.
§Errors
If the file cannot be created or the provisional header cannot be written.
Sourcepub const fn byte_offset(&self) -> u64
pub const fn byte_offset(&self) -> u64
Bytes of audio emitted so far.
Sourcepub fn write_packet(
&mut self,
pcm: &[f32],
raw: &mut dyn Write,
run_id: &str,
frame_count: u8,
) -> Result<Value, FttsError>
pub fn write_packet( &mut self, pcm: &[f32], raw: &mut dyn Write, run_id: &str, frame_count: u8, ) -> Result<Value, FttsError>
Write one packet and return its audio_chunk event.
raw is where PCM goes under --stream raw; it is ignored by the other sinks. The event’s
byte_offset is the offset before this packet, so a consumer can seek with it.
duration_ms is derived from the sample count rather than taken from a caller-supplied
clock: it describes how much audio this packet holds, which is a property of the samples,
not of how long the run took to produce them.
§Errors
If the sink rejects the write.
Auto Trait Implementations§
impl Freeze for AudioOutput
impl RefUnwindSafe for AudioOutput
impl Send for AudioOutput
impl Sync for AudioOutput
impl Unpin for AudioOutput
impl UnsafeUnpin for AudioOutput
impl UnwindSafe for AudioOutput
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).