effect-motion
API Referenceeffect-motionNamespacesEntityVariables

Audio

const Audio: TaggedStruct<"Audio", {

Variable: Audio

const Audio: TaggedStruct<"Audio", {
  audio: TaggedStruct<"effect-motion/Resources/Audio", {
     id: String;
  }>;
  gain: withConstructorDefault<Number>;
  loop: withConstructorDefault<Boolean>;
  playing: withConstructorDefault<Boolean>;
  position: withConstructorDefault<TaggedStruct<"Vec3", {
     x: withConstructorDefault<Number>;
     y: withConstructorDefault<Number>;
     z: withConstructorDefault<Number>;
  }>>;
  rotation: withConstructorDefault<TaggedStruct<"Vec3", {
     x: withConstructorDefault<Number>;
     y: withConstructorDefault<Number>;
     z: withConstructorDefault<Number>;
  }>>;
  time: withConstructorDefault<Number>;
}>;

Defined in: packages/motion/src/Entity.ts:295

A sound in the scene. It never paints: transform fields only (every entity carries them), no opacity/scale/visible — gain is not opacity.

audio is an Audio resource reference; bytes live in the scene's requirements, never in frame data. time is the UNWRAPPED playback cursor in source seconds (players wrap it by the source length when loop), gain is linear amplitude (1 = unity, 0 = silent), and playing is the explicit transport state.

playing/time are transport-owned: while playing, the runner derives time every frame. Prefer the Audio module (play, pause, seek, stop, resume); direct writes are supported and mean the same thing on the frame they land — writing time is a seek, playing: false a pause, playing: true a resume (an instance created playing starts advancing at once) — and, like those operations, cancel a pending clip end.

On this page