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]
fn new() -> AudioEmitter
[src]
Creates 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.
fn play(&mut self, source: &Source) -> Result<(), DecoderError>
[src]
Plays an audio source from this emitter.
fn set_picker(
&mut self,
picker: Box<FnMut(&mut AudioEmitter) -> bool + Send + Sync>
)
[src]
&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.
fn clear_picker(&mut self)
[src]
Clears the previously set picker.
Trait Implementations
impl Default for AudioEmitter
[src]
fn default() -> AudioEmitter
[src]
Returns the "default value" for a type. Read more
impl Component for AudioEmitter
[src]
type Storage = BTreeStorage<Self>
Associated storage type for this component.