Struct rodio::SpatialSink
source · pub struct SpatialSink { /* private fields */ }
Implementations§
source§impl SpatialSink
impl SpatialSink
sourcepub fn try_new(
stream: &OutputStreamHandle,
emitter_position: [f32; 3],
left_ear: [f32; 3],
right_ear: [f32; 3]
) -> Result<SpatialSink, PlayError>
pub fn try_new( stream: &OutputStreamHandle, emitter_position: [f32; 3], left_ear: [f32; 3], right_ear: [f32; 3] ) -> Result<SpatialSink, PlayError>
Builds a new SpatialSink
.
sourcepub fn set_emitter_position(&self, pos: [f32; 3])
pub fn set_emitter_position(&self, pos: [f32; 3])
Sets the position of the sound emitter in 3 dimensional space.
sourcepub fn set_left_ear_position(&self, pos: [f32; 3])
pub fn set_left_ear_position(&self, pos: [f32; 3])
Sets the position of the left ear in 3 dimensional space.
sourcepub fn set_right_ear_position(&self, pos: [f32; 3])
pub fn set_right_ear_position(&self, pos: [f32; 3])
Sets the position of the right ear in 3 dimensional space.
sourcepub fn volume(&self) -> f32
pub fn volume(&self) -> f32
The value 1.0
is the “normal” volume (unfiltered input). Any value other than 1.0 will
multiply each sample by this value.
sourcepub fn set_volume(&self, value: f32)
pub fn set_volume(&self, value: f32)
Changes the volume of the sound.
The value 1.0
is the “normal” volume (unfiltered input). Any value other than 1.0 will
multiply each sample by this value.
sourcepub fn speed(&self) -> f32
pub fn speed(&self) -> f32
Gets the speed of the sound.
The value 1.0
is the “normal” speed (unfiltered input). Any value other than 1.0
will
change the play speed of the sound.
sourcepub fn set_speed(&self, value: f32)
pub fn set_speed(&self, value: f32)
Changes the speed of the sound.
The value 1.0
is the “normal” speed (unfiltered input). Any value other than 1.0
will
change the play speed of the sound.
sourcepub fn pause(&self)
pub fn pause(&self)
Pauses playback of this sink.
No effect if already paused.
A paused sound can be resumed with play()
.
sourcepub fn is_paused(&self) -> bool
pub fn is_paused(&self) -> bool
Gets if a sound is paused
Sounds can be paused and resumed using pause() and play(). This gets if a sound is paused.
sourcepub fn sleep_until_end(&self)
pub fn sleep_until_end(&self)
Sleeps the current thread until the sound ends.