pub struct ChannelStrip {}Expand description
A 3D positioned audio source channel.
Fields§
§id: u64§position: Vec3§volume: f32§bus: BusId§looping: bool§attenuation: AttenuationModel§min_dist: f32§max_dist: f32§reverb_send: f32§pitch_shift: f32§active: boolWhether this channel is actively playing.
age: f32Age of this channel (seconds since spawn).
max_age: Option<f32>Optional max age (for one-shots, set from sample duration).
Implementations§
Source§impl ChannelStrip
impl ChannelStrip
pub fn new(id: u64, position: Vec3, bus: BusId) -> Self
pub fn one_shot(self, duration_s: f32) -> Self
pub fn looping(self) -> Self
pub fn tick(&mut self, dt: f32)
Sourcepub fn stereo_gain(&self, listener: Vec3) -> (f32, f32)
pub fn stereo_gain(&self, listener: Vec3) -> (f32, f32)
Compute the effective stereo gain for this channel given listener position.
pub fn is_expired(&self) -> bool
Trait Implementations§
Source§impl Clone for ChannelStrip
impl Clone for ChannelStrip
Source§fn clone(&self) -> ChannelStrip
fn clone(&self) -> ChannelStrip
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for ChannelStrip
impl RefUnwindSafe for ChannelStrip
impl Send for ChannelStrip
impl Sync for ChannelStrip
impl Unpin for ChannelStrip
impl UnsafeUnpin for ChannelStrip
impl UnwindSafe for ChannelStrip
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.