#[non_exhaustive]pub enum SoundRequest {
Sound {
cue: String,
volume: f32,
},
#[non_exhaustive] Start {
id: SoundId,
cue: String,
volume: f32,
},
Stop {
id: SoundId,
},
Volume {
id: SoundId,
volume: f32,
},
PauseSounds,
ResumeSounds,
Voice {
clip: String,
},
StopVoice,
PreloadVoices {
clips: Vec<String>,
},
#[non_exhaustive] Add {
cue: String,
samples: SharedSamples,
},
Remove {
cue: String,
},
}Expand description
A sound or voice request as the device gets it: a screen’s
AudioRequest with each voice clip named by its file in the game’s
voice folder (clip_file). The music’s requests are already
MusicCommands.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Sound
Play a sound cue once, at volume (0–1) times the cue’s own volume.
#[non_exhaustive]Start
Play a sound cue until Stop of its id: looped if
the cue says so, else once. Build it with SoundRequest::start
(ADR-0039).
Fields
This variant is marked as non-exhaustive
Stop
Stop the sound started as id, at once: that one playback, not the
cue’s others.
Volume
Set the volume of the sound started as id.
PauseSounds
Pause every sound started with a handle that is playing now; one started after it plays. Sound cues played once, the music and the voice go on. A sound paused keeps the volume it is given and sounds at it when it resumes; one stopped while paused is gone.
ResumeSounds
Resume the sounds PauseSounds paused.
Voice
Say a line: play its clip once, stopping the voice that is playing.
StopVoice
Stop the voice that is playing, if any.
PreloadVoices
The clips a scene will ask for, in order, so the device can load the next few ahead. Replaces the list sent before.
#[non_exhaustive]Add
Make samples the sound cue cue, which the manifest doesn’t have:
Sound and Start of it play it at its
own volume, full, once. A cue added before is replaced. Build it with
SoundRequest::add (ADR-0039). A record of it holds the samples’
rate, channels and frames, not the samples.
Fields
This variant is marked as non-exhaustive
samples: SharedSamplesIts samples.
Remove
Forget the sound cue cue that Add made, stopping
what plays it.
Implementations§
Source§impl SoundRequest
impl SoundRequest
Sourcepub fn start(id: SoundId, cue: impl Into<String>, volume: f32) -> Self
pub fn start(id: SoundId, cue: impl Into<String>, volume: f32) -> Self
A Start of cue as id at volume.
Sourcepub fn from_request<V: ClipVariant>(request: &AudioRequest<V>) -> Option<Self>
pub fn from_request<V: ClipVariant>(request: &AudioRequest<V>) -> Option<Self>
request as the device gets it; None for a music request, which
the frame’s music commands already say.
Trait Implementations§
Source§impl Clone for SoundRequest
impl Clone for SoundRequest
Source§fn clone(&self) -> SoundRequest
fn clone(&self) -> SoundRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more