Struct rich_sdl2_rust::mixer::chunk::MixChunk
source · pub struct MixChunk<'device> { /* private fields */ }
Expand description
A chunk buffer of the audio data.
Implementations§
source§impl<'device> MixChunk<'device>
impl<'device> MixChunk<'device>
sourcepub unsafe fn from_file_bytes_unchecked(
_device: &'device MixDevice<'device>,
file: &[u8]
) -> Self
pub unsafe fn from_file_bytes_unchecked( _device: &'device MixDevice<'device>, file: &[u8] ) -> Self
Constructs a chunk from the wave file bytes.
§Safety
buf
must be a valid WAVE format file bytes. Otherwise the Undefined Behavior occurs.
sourcepub unsafe fn from_buf_unchecked(
_device: &'device MixDevice<'device>,
buf: &'device mut [u8]
) -> Self
pub unsafe fn from_buf_unchecked( _device: &'device MixDevice<'device>, buf: &'device mut [u8] ) -> Self
Constructs a chunk from the raw wave buffer bytes.
§Safety
buf
must be a valid WAVE format buffer bytes. Otherwise the Undefined Behavior occurs.
sourcepub fn set_volume(&self, volume: u32)
pub fn set_volume(&self, volume: u32)
Sets the output volume of the chunk. The volume is clamped to 0..=128
.
Trait Implementations§
Auto Trait Implementations§
impl<'device> !RefUnwindSafe for MixChunk<'device>
impl<'device> !Send for MixChunk<'device>
impl<'device> !Sync for MixChunk<'device>
impl<'device> Unpin for MixChunk<'device>
impl<'device> !UnwindSafe for MixChunk<'device>
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