[−][src]Struct rusty_engine::prelude::Audio
A simple 4-track audio system to load/decode audio files from disk to play later. Supported formats are: MP3, WAV, Vorbis and Flac.
Methods
impl Audio
[src]
pub fn new() -> Audio
[src]
Create a new sound subsystem. You only need one of these -- you can use it to load and play any number of audio clips.
pub fn add(&mut self, name: &'static str, path: &str)
[src]
Add an audio clip to play. Audio clips will be decoded and buffered during this call so
the first call to .play()
is not staticky if you compile in debug mode. name
is what
you will refer to this clip as when you need to play it. Files known to be supported by the
underlying library (rodio) at the time of this writing are MP3, WAV, Vorbis and Flac.
pub fn play(&mut self, name: &str)
[src]
Play an audio clip that has already been loaded. name
is the name you chose when you
added the clip to the Audio
system. If you forgot to load the clip first, this will crash.
pub fn wait(&self)
[src]
Block until no sounds are playing. Convenient for keeping a thread alive until all sounds have played.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Audio
impl Send for Audio
impl Sync for Audio
impl Unpin for Audio
impl UnwindSafe for Audio
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> Same<T> for T
type Output = T
Should always be Self
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,