pub struct Sound { /* fields omitted */ }
Sound data that can be played back.
Supports WAV, Ogg Vorbis, MP3 and FLAC (in other words, everything that
Rodio provides support for).
All of the playback methods on this type return a SoundInstance
that
can be used to control the sound after it has started. If you just want
to 'fire and forget' a sound, you can discard it - the sound will
continue playing regardless.
This type acts as a lightweight handle to the associated audio data,
and so can be cloned with little overhead.
Creates a new sound from the given file.
If the file path is invalid, a TetraError::Io
will be returned. Note that the data
is not decoded until playback begins, so this function will not validate
that the data being read is formatted correctly.
Plays the sound.
If there is no active audio device, a TetraError::NoAudioDevice
will be returned.
If the sound data could not be decoded, a TetraError::FailedToDecodeAudio
will be returned.
Plays the sound repeatedly.
If there is no active audio device, a TetraError::NoAudioDevice
will be returned.
If the sound data could not be decoded, a TetraError::FailedToDecodeAudio
will be returned.
Spawns a new instance of the sound that is not playing yet.
If there is no active audio device, a TetraError::NoAudioDevice
will be returned.
If the sound data could not be decoded, a TetraError::FailedToDecodeAudio
will be returned.
Plays the sound, with the provided settings.
If there is no active audio device, a TetraError::NoAudioDevice
will be returned.
If the sound data could not be decoded, a TetraError::FailedToDecodeAudio
will be returned.
Plays the sound repeatedly, with the provided settings.
If there is no active audio device, a TetraError::NoAudioDevice
will be returned.
If the sound data could not be decoded, a TetraError::FailedToDecodeAudio
will be returned.
Spawns a new instance of the sound that is not playing yet, with the provided settings.
If there is no active audio device, a TetraError::NoAudioDevice
will be returned.
If the sound data could not be decoded, a TetraError::FailedToDecodeAudio
will be returned.
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<SS, SP> SupersetOf for SP where SS: SubsetOf<SP>, | |
The inverse inclusion map: attempts to construct self
from the equivalent element of its superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.
impl<T> SetParameter for T | |
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where T: Parameter<Self>, | |
Sets value
as a parameter of self
.