pub struct AudioBus { /* private fields */ }Expand description
Cross-platform deterministic game audio mixer queue (bridged to WebAudio / CoreAudio / AAudio / WASAPI).
Implementations§
Source§impl AudioBus
Sound cue scheduling and frame draining for AudioBus.
impl AudioBus
Sound cue scheduling and frame draining for AudioBus.
Sourcepub fn play(&mut self, cue: SoundCue, volume: f32, pan: f32, pitch: f32)
pub fn play(&mut self, cue: SoundCue, volume: f32, pan: f32, pitch: f32)
Queues a sound cue with normalized volume, pan, and pitch.
§Arguments
&Self- Mutable audio bus.SoundCue- Sound cue to play.f32- Linear volume[0.0, 1.0].f32- Stereo pan[-1.0, 1.0].f32- Pitch multiplier[0.25, 4.0].
Sourcepub fn drain(&mut self) -> Vec<AudioCommand>
pub fn drain(&mut self) -> Vec<AudioCommand>
Sourcepub fn drain_into(&mut self, out: &mut Vec<AudioCommand>)
pub fn drain_into(&mut self, out: &mut Vec<AudioCommand>)
Drains all queued audio commands into caller-provided out preserving capacity on both buffers (zero steady-state allocations).
§Arguments
&Self- Mutable audio bus.&mut Vec<AudioCommand>- Reusable destination buffer cleared and populated in place.
Sourcepub fn clear_queue(&mut self)
pub fn clear_queue(&mut self)
Clears all queued audio commands in place while preserving allocated capacity.
§Arguments
&Self- Mutable audio bus.
Sourcepub fn play_spatial_3d(
&mut self,
listener: &AudioListener3D,
source: &SpatialAudioSource3D,
)
pub fn play_spatial_3d( &mut self, listener: &AudioListener3D, source: &SpatialAudioSource3D, )
Spatializes a 3D sound emitter relative to listener with inverse-distance attenuation, stereo ear panning, and Doppler shift.
§Arguments
&Self- Mutable audio bus.&AudioListener3D- Active 3D listener pose.&SpatialAudioSource3D- World-space sound source parameters.
Source§impl AudioBus
impl AudioBus
pub fn get_master_volume(&self) -> f32
pub fn get_mut_master_volume(&mut self) -> &mut f32
pub fn set_master_volume(&mut self, val: f32) -> &mut Self
pub fn get_muted(&self) -> bool
pub fn get_mut_muted(&mut self) -> &mut bool
pub fn set_muted(&mut self, val: bool) -> &mut Self
pub fn get_queue(&self) -> &Vec<AudioCommand>
pub fn get_mut_queue(&mut self) -> &mut Vec<AudioCommand>
pub fn set_queue(&mut self, val: Vec<AudioCommand>) -> &mut Self
pub fn get_total_played(&self) -> u64
pub fn get_mut_total_played(&mut self) -> &mut u64
pub fn set_total_played(&mut self, val: u64) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Forget for AudioBus
impl Freeze for AudioBus
impl Move for AudioBus
impl RefUnwindSafe for AudioBus
impl Send for AudioBuswhere
RawVecInner: Send,
impl Sync for AudioBuswhere
RawVecInner: Sync,
impl Unpin for AudioBus
impl UnsafeUnpin for AudioBus
impl UnwindSafe for AudioBuswhere
RawVecInner: UnwindSafe,
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