We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4583b3d commit 6267d43Copy full SHA for 6267d43
src/sdl2/mixer/mod.rs
@@ -305,6 +305,12 @@ impl Chunk {
305
Self::from_owned_raw(raw)
306
}
307
308
+ /// Load from `RWOps` for use as a sample.
309
+ pub fn from_rwops(rwops: RWops) -> Result<Chunk, String> {
310
+ let raw = unsafe { mixer::Mix_LoadWAV_RW(rwops.raw(), 0) };
311
+ Self::from_owned_raw(raw)
312
+ }
313
+
314
/// Load chunk from a buffer containing raw audio data in the mixer format. The length of the
315
/// buffer has to fit in 32-bit unsigned integer. The chunk takes ownership of the buffer.
316
///
0 commit comments