Struct amethyst_audio::AudioEmitter [−][src]
pub struct AudioEmitter { /* fields omitted */ }An audio source, add this component to anything that emits sound.
Methods
impl AudioEmitter[src]
impl AudioEmitterpub fn new() -> AudioEmitter[src]
pub fn new() -> AudioEmitterCreates a new AudioEmitter component initialized to the given positions. These positions will stay synced with Transform if the Transform component is available on this entity.
pub fn play(&mut self, source: &Source) -> Result<(), DecoderError>[src]
pub fn play(&mut self, source: &Source) -> Result<(), DecoderError>Plays an audio source from this emitter.
pub fn set_picker(
&mut self,
picker: Box<FnMut(&mut AudioEmitter) -> bool + Send + Sync>
)[src]
pub fn set_picker(
&mut self,
picker: Box<FnMut(&mut AudioEmitter) -> bool + Send + Sync>
)An emitter's picker will be called by the AudioSystem whenever the emitter runs out of sounds to play.
During callback the picker is separated from the emitter in order to avoid multiple aliasing. After the callback is complete, if the picker returned true then the picker that just finished will be reattached.
pub fn clear_picker(&mut self)[src]
pub fn clear_picker(&mut self)Clears the previously set picker.
Trait Implementations
impl Default for AudioEmitter[src]
impl Default for AudioEmitterfn default() -> AudioEmitter[src]
fn default() -> AudioEmitterReturns the "default value" for a type. Read more
impl Component for AudioEmitter[src]
impl Component for AudioEmittertype Storage = BTreeStorage<Self>
Associated storage type for this component.
Auto Trait Implementations
impl Send for AudioEmitter
impl Send for AudioEmitterimpl Sync for AudioEmitter
impl Sync for AudioEmitter