Struct rodio::SpatialSink

source ·
pub struct SpatialSink { /* private fields */ }

Implementations§

source§

impl SpatialSink

source

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.

source

pub fn set_emitter_position(&self, pos: [f32; 3])

Sets the position of the sound emitter in 3 dimensional space.

source

pub fn set_left_ear_position(&self, pos: [f32; 3])

Sets the position of the left ear in 3 dimensional space.

source

pub fn set_right_ear_position(&self, pos: [f32; 3])

Sets the position of the right ear in 3 dimensional space.

source

pub fn append<S>(&self, source: S)where S: Source + Send + 'static, f32: FromSample<S::Item>, S::Item: Sample + Send,

Appends a sound to the queue of sounds to play.

source

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.

source

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.

source

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.

source

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.

source

pub fn play(&self)

Resumes playback of a paused sound.

No effect if not paused.

source

pub fn pause(&self)

Pauses playback of this sink.

No effect if already paused.

A paused sound can be resumed with play().

source

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.

source

pub fn stop(&self)

Stops the sink by emptying the queue.

source

pub fn detach(self)

Destroys the sink without stopping the sounds that are still playing.

source

pub fn sleep_until_end(&self)

Sleeps the current thread until the sound ends.

source

pub fn empty(&self) -> bool

Returns true if this sink has no more sounds to play.

source

pub fn len(&self) -> usize

Returns the number of sounds currently in the queue.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for Fwhere T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,