pub struct AudioClip {
pub asset_id: AssetId,
pub source: String,
pub locator: Option<PayloadLocator>,
}Expand description
A baked audio clip: the sound an AudioEmitter plays.
The build reads the source file (any format the engine can decode:
.ogg, .wav, .flac, .mp3) and packs it into the world.
An AudioClip is inert on its own: reference it from an
AudioEmitter’s clip field to place the sound in the world.
AudioClip {
source: "audio/fire_crackle.ogg".into(),
..Default::default()
};Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
source: StringPath to the source audio file.
locator: Option<PayloadLocator>Injected at load time from the compiled blob payload.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AudioClip
impl<'de> Deserialize<'de> for AudioClip
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl ResourceAsset for AudioClip
Auto Trait Implementations§
impl Freeze for AudioClip
impl RefUnwindSafe for AudioClip
impl Send for AudioClip
impl Sync for AudioClip
impl Unpin for AudioClip
impl UnsafeUnpin for AudioClip
impl UnwindSafe for AudioClip
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