pub struct DopplerProcessor { /* private fields */ }Expand description
Doppler effect processor for moving sources and listeners
Implementations§
Source§impl DopplerProcessor
impl DopplerProcessor
Sourcepub fn with_speed_of_sound(sample_rate: f32, speed_of_sound: f32) -> Self
pub fn with_speed_of_sound(sample_rate: f32, speed_of_sound: f32) -> Self
Create Doppler processor with custom speed of sound
Sourcepub fn calculate_doppler_factor(
&self,
source_position: Position3D,
source_velocity: Position3D,
listener_position: Position3D,
listener_velocity: Position3D,
) -> f32
pub fn calculate_doppler_factor( &self, source_position: Position3D, source_velocity: Position3D, listener_position: Position3D, listener_velocity: Position3D, ) -> f32
Calculate Doppler factor for source and listener
Sourcepub fn process_doppler_effect(
&self,
input: &[f32],
output: &mut [f32],
doppler_factor: f32,
) -> Result<()>
pub fn process_doppler_effect( &self, input: &[f32], output: &mut [f32], doppler_factor: f32, ) -> Result<()>
Apply Doppler effect to audio buffer
Sourcepub fn smooth_doppler_factor(&self, current: f32, target: f32) -> f32
pub fn smooth_doppler_factor(&self, current: f32, target: f32) -> f32
Smooth Doppler factor transitions
Sourcepub fn set_speed_of_sound(&mut self, speed: f32)
pub fn set_speed_of_sound(&mut self, speed: f32)
Set speed of sound (useful for different atmospheric conditions)
Sourcepub fn speed_of_sound(&self) -> f32
pub fn speed_of_sound(&self) -> f32
Get current speed of sound
Trait Implementations§
Source§impl Clone for DopplerProcessor
impl Clone for DopplerProcessor
Source§fn clone(&self) -> DopplerProcessor
fn clone(&self) -> DopplerProcessor
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 DopplerProcessor
impl RefUnwindSafe for DopplerProcessor
impl Send for DopplerProcessor
impl Sync for DopplerProcessor
impl Unpin for DopplerProcessor
impl UnsafeUnpin for DopplerProcessor
impl UnwindSafe for DopplerProcessor
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more