pub struct SoundData(_);
Expand description
Static sound data stored in memory.
It is Arc
’ed, so cheap to clone.
Implementations§
source§impl SoundData
impl SoundData
sourcepub fn new<P: AsRef<Path>>(
fs: &impl Has<Filesystem>,
path: P
) -> GameResult<Self>
pub fn new<P: AsRef<Path>>( fs: &impl Has<Filesystem>, path: P ) -> GameResult<Self>
Load the file at the given path and create a new SoundData
from it.
sourcepub fn from_bytes(data: &[u8]) -> Self
pub fn from_bytes(data: &[u8]) -> Self
Copies the data in the given slice into a new SoundData
object.
sourcepub fn from_read<R>(reader: &mut R) -> GameResult<Self>where
R: Read,
pub fn from_read<R>(reader: &mut R) -> GameResult<Self>where R: Read,
Creates a SoundData
from any Read
object; this involves
copying it into a buffer.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for SoundData
impl Send for SoundData
impl Sync for SoundData
impl Unpin for SoundData
impl UnwindSafe for SoundData
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
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
source§impl<T> HasMut<T> for T
impl<T> HasMut<T> for T
source§fn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.