oa::audio::AudioEncoder

Stateful deterministic PCM-S16 audio encoder. Input is interleaved FP32. Complete configured packets are emitted by encode; flush emits a final partial packet. close deliberately discards an unflushed partial packet, matching the donor lifecycle contract. Dropping the encoder only releases host state and never flushes implicitly.

StRust public API

Declaration

pub struct AudioEncoder { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn encode(&mut self, interleaved: &[f32]) -> Result<Vec<EncodedAudioPacket>>
pub fn flush(&mut self) -> Result<Vec<EncodedAudioPacket>>
pub fn close(&mut self)
pub const fn is_open(&self) -> bool
pub fn profile(&self) -> Option<&AudioEncodeProfile>
pub const fn codec_config(&self) -> &[u8] ⓘ
pub const fn priming_frames(&self) -> u32
fn fmt(&self, f: &mut Formatter<'_>) -> Result

Associated Functions

pub fn create(profile: AudioEncodeProfile) -> Result<Self>

Public Method Documentation

pub fn encode( &mut self, interleaved: &[f32] ) -> Result<Vec<EncodedAudioPacket>>
No public source comment is attached to this declaration.
pub fn flush( &mut self ) -> Result<Vec<EncodedAudioPacket>>
No public source comment is attached to this declaration.
pub fn close( &mut self )
No public source comment is attached to this declaration.
pub const fn is_open( &self ) -> bool
No public source comment is attached to this declaration.
pub fn profile( &self ) -> Option<&AudioEncodeProfile>
No public source comment is attached to this declaration.
pub const fn codec_config( &self ) -> &[u8] ⓘ
No public source comment is attached to this declaration.
pub const fn priming_frames( &self ) -> u32
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
pub fn create( profile: AudioEncodeProfile ) -> Result<Self>
No public source comment is attached to this declaration.