pub struct AudioSource { /* private fields */ }Implementations§
Source§impl AudioSource
impl AudioSource
pub fn new(audio: Cow<'static, str>, streaming: bool) -> Self
pub fn new_play(audio: Cow<'static, str>, streaming: bool, play: bool) -> Self
pub fn new_complex( audio: Cow<'static, str>, streaming: bool, looped: bool, playback_rate: Scalar, volume: Scalar, play: bool, ) -> Self
pub fn audio(&self) -> &str
pub fn streaming(&self) -> bool
pub fn looped(&self) -> bool
pub fn set_looped(&mut self, looped: bool)
pub fn playback_rate(&self) -> Scalar
pub fn set_playback_rate(&mut self, playback_rate: Scalar)
pub fn volume(&self) -> Scalar
pub fn set_volume(&mut self, volume: Scalar)
pub fn current_time(&self) -> Option<Scalar>
pub fn is_playing(&self) -> bool
pub fn play(&mut self)
pub fn stop(&mut self)
pub fn is_ready(&self) -> bool
Trait Implementations§
Source§impl Clone for AudioSource
impl Clone for AudioSource
Source§fn clone(&self) -> AudioSource
fn clone(&self) -> AudioSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AudioSource
impl Debug for AudioSource
Source§impl Default for AudioSource
impl Default for AudioSource
Source§impl From<AudioSourceConfig> for AudioSource
impl From<AudioSourceConfig> for AudioSource
Source§fn from(config: AudioSourceConfig) -> Self
fn from(config: AudioSourceConfig) -> Self
Converts to this type from the input type.
Source§impl PrefabProxy<AudioSourceConfig> for AudioSource
impl PrefabProxy<AudioSourceConfig> for AudioSource
fn from_proxy_with_extras( proxy: AudioSourcePrefabProxy, _: &HashMap<String, Entity>, _: StateToken, ) -> Result<Self, PrefabError>
Auto Trait Implementations§
impl Freeze for AudioSource
impl RefUnwindSafe for AudioSource
impl Send for AudioSource
impl Sync for AudioSource
impl Unpin for AudioSource
impl UnsafeUnpin for AudioSource
impl UnwindSafe for AudioSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more