[][src]Struct ggez::audio::SpatialSource

pub struct SpatialSource { /* fields omitted */ }

A source of audio data located in space relative to a listener's ears. Will stop playing when dropped.

Methods

impl SpatialSource[src]

pub fn new<P: AsRef<Path>>(context: &mut Context, path: P) -> GameResult<Self>[src]

Create a new SpatialSource from the given file.

pub fn from_data(context: &mut Context, data: SoundData) -> GameResult<Self>[src]

Creates a new SpatialSource using the given SoundData object.

impl SpatialSource[src]

pub fn set_position<P>(&mut self, pos: P) where
    P: Into<Point3<f32>>, 
[src]

Set location of the sound.

pub fn set_ears<P>(&mut self, left: P, right: P) where
    P: Into<Point3<f32>>, 
[src]

Set locations of the listener's ears

Trait Implementations

impl SoundSource for SpatialSource[src]

fn play_later(&self) -> GameResult[src]

Plays the SpatialSource; waits until done if the sound is currently playing.

fn play(&mut self) -> GameResult[src]

Plays the audio source; restarts the sound if currently playing

impl Debug for SpatialSource[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> Erased for T

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.