pub struct Audio<'a> { /* private fields */ }Expand description
A parsed .psau SPU audio sample backed by the caller’s cooked blob.
Implementations§
Source§impl<'a> Audio<'a>
impl<'a> Audio<'a>
Sourcepub fn from_bytes(bytes: &'a [u8]) -> Result<Self, ParseError>
pub fn from_bytes(bytes: &'a [u8]) -> Result<Self, ParseError>
Parse a cooked .psau blob.
Sourcepub fn sample_rate_hz(&self) -> u32
pub fn sample_rate_hz(&self) -> u32
Playback sample rate in Hz.
Sourcepub fn sample_count(&self) -> u32
pub fn sample_count(&self) -> u32
Audible mono sample count before encoder padding.
Sourcepub fn adpcm_block_count(&self) -> u32
pub fn adpcm_block_count(&self) -> u32
Number of 16-byte SPU ADPCM blocks.
Sourcepub fn loop_start_block(&self) -> Option<u32>
pub fn loop_start_block(&self) -> Option<u32>
Loop-start block, or None for one-shot samples.
Sourcepub fn adpcm_bytes(&self) -> &'a [u8]
pub fn adpcm_bytes(&self) -> &'a [u8]
Raw SPU ADPCM bytes ready for upload.
Sourcepub fn is_one_shot(&self) -> bool
pub fn is_one_shot(&self) -> bool
Whether this sample is a non-looping one-shot.
Trait Implementations§
impl<'a> Copy for Audio<'a>
Auto Trait Implementations§
impl<'a> Freeze for Audio<'a>
impl<'a> RefUnwindSafe for Audio<'a>
impl<'a> Send for Audio<'a>
impl<'a> Sync for Audio<'a>
impl<'a> Unpin for Audio<'a>
impl<'a> UnsafeUnpin for Audio<'a>
impl<'a> UnwindSafe for Audio<'a>
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)