pub struct AdpcmState {
pub channel_layout: Channels,
pub frame_length: usize,
pub channels: Vec<AdpcmChannelState>,
pub frame_bytes: usize,
pub header_bytes: usize,
pub header_size: usize,
pub encoding_type: SampleType,
pub sample_rate: u32,
pub current_header: Option<Vec<u8>>,
pub low_nibble: bool,
pub pending_byte: u8,
pub current_channel: usize,
}Expand description
Manages the state for ADPCM and PCM encoding/decoding within a stream.
This state handles the framing, headers, and adaptive predictor values for ADPCM.
Although it is named AdpcmState, it supports all formats defined in SampleType,
including 8-bit and 16-bit PCM.
Fields§
§channel_layout: Channels§frame_length: usize§channels: Vec<AdpcmChannelState>§frame_bytes: usize§header_bytes: usize§header_size: usize§encoding_type: SampleType§sample_rate: u32§current_header: Option<Vec<u8>>§low_nibble: bool§pending_byte: u8§current_channel: usizeImplementations§
Source§impl AdpcmState
impl AdpcmState
pub fn new(channel_layout: Channels, frame_length: usize) -> Self
pub fn with_type( channel_layout: Channels, frame_length: usize, encoding_type: SampleType, sample_rate: u32, ) -> Self
pub fn get_header_size(channel_layout: Channels) -> usize
pub fn encode(&mut self, input: &[i16], output: &mut [u8]) -> (usize, usize)
pub fn decode( &mut self, input: &[u8], output: &mut [i16], ) -> Result<(usize, usize), AdpcmError>
Auto Trait Implementations§
impl Freeze for AdpcmState
impl RefUnwindSafe for AdpcmState
impl Send for AdpcmState
impl Sync for AdpcmState
impl Unpin for AdpcmState
impl UnsafeUnpin for AdpcmState
impl UnwindSafe for AdpcmState
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