Struct ambient_api_core::prelude::audio::AudioPlayer
source · pub struct AudioPlayer {
pub entity: EntityId,
}
Available on crate feature
client
only.Expand description
Play the audio file at the given URL.
Fields§
§entity: EntityId
The entity that represents the audio player
Implementations§
source§impl AudioPlayer
impl AudioPlayer
sourcepub fn set_looping(&self, val: bool)
pub fn set_looping(&self, val: bool)
Set the sound looping or not
sourcepub fn add_one_pole_lpf(&self, rolloff_freq: f32)
pub fn add_one_pole_lpf(&self, rolloff_freq: f32)
Add a simple onepole lowpass filter to the sound with one param: roll off frequency
sourcepub fn set_amplitude(&self, amp: f32)
pub fn set_amplitude(&self, amp: f32)
Set the amp/volume of the sound 0.0 is 0%, 1.0 is 100%
sourcepub fn set_panning(&self, pan: f32)
pub fn set_panning(&self, pan: f32)
Set the panning of the sound -1.0 is 100% left, 1.0 is 100% right.
Trait Implementations§
source§impl Clone for AudioPlayer
impl Clone for AudioPlayer
source§fn clone(&self) -> AudioPlayer
fn clone(&self) -> AudioPlayer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AudioPlayer
impl Debug for AudioPlayer
Auto Trait Implementations§
impl RefUnwindSafe for AudioPlayer
impl Send for AudioPlayer
impl Sync for AudioPlayer
impl Unpin for AudioPlayer
impl UnwindSafe for AudioPlayer
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