Motion
Get Motion

ReferenceScripting APIMotionSoundLayer

MotionSoundLayer

interface

A Sound layer, by its name or id (scene.sound). Read it with its properties, change it with its methods.

NameMotionSoundLayer
Kindinterface
Script reaches it asMotionScene.sound()
Since0.3

Syntax

interface MotionSoundLayer { … }

Properties

NameTypeDescription
idpropertyreadonly stringIts id ("" when there's no such layer).
namepropertyreadonly stringIts name.
playingpropertyreadonly booleanWhether it's playing (not held), as of the last frame.
timepropertyreadonly numberWhere it is in its sound, seconds.

Methods

SignatureDescription
play(): voidmethodPlays it from its start.
stop(): voidmethodStops it.
pause(): voidmethodHolds it where it is.
resume(): voidmethodPlays it on from where it was held.
setVolume(volume: number): voidmethodTurns it up or down, over its own volume.
setPan(pan: number): voidmethodPans it.
fadeTo(volume: number, seconds: number): voidmethodMoves its volume to a new one over seconds.