[−][src]Struct sdl2::mixer::Chunk
The internal format for an audio chunk.
Fields
raw: *mut Mix_Chunk
owned: bool
Methods
impl Chunk
[src]
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Chunk, String>
[src]
Load file for use as a sample.
pub fn from_raw_buffer<T: AudioFormatNum>(
buffer: Box<[T]>
) -> Result<Chunk, String>
[src]
buffer: Box<[T]>
) -> Result<Chunk, String>
Load chunk from a buffer containing raw audio data in the mixer format. The length of the buffer has to fit in 32-bit unsigned integer. The chunk takes ownership of the buffer.
It's your responsibility to provide the audio data in the right format, as no conversion will take place when using this method.
pub fn set_volume(&mut self, volume: i32) -> i32
[src]
Set chunk->volume to volume.
pub fn get_volume(&self) -> i32
[src]
current volume for the chunk.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Chunk
impl !Send for Chunk
impl !Sync for Chunk
impl Unpin for Chunk
impl UnwindSafe for Chunk
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,