pub struct NwaReader { /* private fields */ }Expand description
NWA reader with random access by frame index.
Implementations§
Source§impl NwaReader
impl NwaReader
pub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open_with_offset( path: impl AsRef<Path>, base_offset: u64, ) -> Result<Self>
pub fn open_from_bytes(bytes: Vec<u8>) -> Result<Self>
pub fn header(&self) -> &NwaHeader
Sourcepub fn set_read_sample_pos(&mut self, frame_pos: u32)
pub fn set_read_sample_pos(&mut self, frame_pos: u32)
Set current read position in frames.
Sourcepub fn get_read_sample_pos(&self) -> u32
pub fn get_read_sample_pos(&self) -> u32
Get current read position in frames.
Sourcepub fn read_samples(&mut self, frame_cnt: u32) -> Result<Vec<u8>>
pub fn read_samples(&mut self, frame_cnt: u32) -> Result<Vec<u8>>
Read frame_cnt frames into an interleaved PCM byte buffer.
Returns exactly frames_read frames worth of data.
Sourcepub fn to_wav_bytes(&mut self) -> Result<Vec<u8>>
pub fn to_wav_bytes(&mut self) -> Result<Vec<u8>>
Convert the entire NWA stream into a WAV (RIFF PCM) byte vector.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NwaReader
impl !RefUnwindSafe for NwaReader
impl !Send for NwaReader
impl !Sync for NwaReader
impl Unpin for NwaReader
impl UnsafeUnpin for NwaReader
impl !UnwindSafe for NwaReader
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