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 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 AudioBus
impl Sync for AudioBus
impl Unpin for AudioBus
impl UnsafeUnpin for AudioBus
impl UnwindSafe for AudioBus
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