pub struct Play {Show 14 fields
pub resampling: ResamplingQuality,
pub bus: BusId,
pub gain: f32,
pub pan: f32,
pub looping: Loop,
pub fade_in: Fade,
pub priority: u8,
pub rate: f32,
pub pitch: f32,
pub variation: Variation,
pub start: TimePosition,
pub instances: Option<Instances>,
pub position: Option<[f32; 2]>,
pub emitter: Option<Emitter>,
}Expand description
How a voice starts playing.
Fields§
§resampling: ResamplingQualityInterpolation quality fixed at voice creation. Default sinc; Linear has no anti-alias filter and is cheaper. Integral unit-speed samples stay exact.
bus: BusId§gain: f32Linear gain, at least 0. Default 1.
pan: f32-1 (left) to 1 (right). Default 0.
looping: Loop§fade_in: Fade§priority: u8Decides which voice gives way when too many play. Default 128.
rate: f32Playback rate, which changes speed and pitch together: 2 plays twice as fast and an octave higher. 1/16..=8. Default 1.
pitch: f32Pitch offset in semitones on top of the rate; fractions are cents, so 0.01 is
one cent. -48..=48. Rate, pitch and Variation::pitch together span
1/1024..=512 times the speed. Default 0.
variation: VariationRandom variation of pitch and gain, drawn from the mixer’s seed.
start: TimePositionWhere in the sound to start, in seconds or source frames; a negative position counts from the end of a sound of known length. A stream seeks there before the voice is sent. Default the start.
instances: Option<Instances>Limits on how many voices of this sound play at once and how often it starts.
position: Option<[f32; 2]>The sound’s position relative to the listener, such as the camera’s centre, in
the units of MixerConfig::space. It sets the voice’s pan, replacing
Play::pan, and a distance gain on top of Play::gain. Default none.
emitter: Option<Emitter>Optional 3D point emitter. Takes precedence over pan; cannot combine with position.