pub struct HcaDecoder<R: Read + Seek> { /* private fields */ }Expand description
High-level HCA decoder wrapping the low-level ClHCA decoder with streaming capabilities
Implementations§
Source§impl HcaDecoder<File>
impl HcaDecoder<File>
Sourcepub fn from_file(filename: &str) -> Result<Self, HcaDecoderError>
pub fn from_file(filename: &str) -> Result<Self, HcaDecoderError>
Create a new HCA decoder from a file path
Source§impl<R: Read + Seek> HcaDecoder<R>
impl<R: Read + Seek> HcaDecoder<R>
Sourcepub fn from_reader(reader: R) -> Result<Self, HcaDecoderError>
pub fn from_reader(reader: R) -> Result<Self, HcaDecoderError>
Create a new HCA decoder from a reader
Sourcepub fn set_encryption_key(&mut self, keycode: u64, subkey: u64)
pub fn set_encryption_key(&mut self, keycode: u64, subkey: u64)
Set the decryption key
Sourcepub fn decode_frame(&mut self) -> Result<(&[f32], usize), HcaDecoderError>
pub fn decode_frame(&mut self) -> Result<(&[f32], usize), HcaDecoderError>
Decode a single frame and return the samples Returns (samples slice, num samples) or error
Sourcepub fn decode_all(&mut self) -> Result<Vec<f32>, HcaDecoderError>
pub fn decode_all(&mut self) -> Result<Vec<f32>, HcaDecoderError>
Decode the entire HCA file and return all samples
Sourcepub fn decode_to_wav<W: Write>(
&mut self,
w: &mut W,
) -> Result<(), HcaDecoderError>
pub fn decode_to_wav<W: Write>( &mut self, w: &mut W, ) -> Result<(), HcaDecoderError>
Decode the entire file to 16-bit WAV stream
Auto Trait Implementations§
impl<R> Freeze for HcaDecoder<R>where
R: Freeze,
impl<R> RefUnwindSafe for HcaDecoder<R>where
R: RefUnwindSafe,
impl<R> Send for HcaDecoder<R>where
R: Send,
impl<R> Sync for HcaDecoder<R>where
R: Sync,
impl<R> Unpin for HcaDecoder<R>where
R: Unpin,
impl<R> UnsafeUnpin for HcaDecoder<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for HcaDecoder<R>where
R: UnwindSafe,
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