ReferenceScripting APIMotionSoundLayer
MotionSoundLayer
interfaceA Sound layer, by its name or id (scene.sound). Read it with its properties, change it with its methods.
| Name | MotionSoundLayer |
|---|---|
| Kind | interface |
| Script reaches it as | MotionScene.sound() |
| Since | 0.3 |
Syntax
interface MotionSoundLayer { … }Properties
| Name | Type | Description |
|---|---|---|
idproperty | readonly string | Its id ("" when there's no such layer). |
nameproperty | readonly string | Its name. |
playingproperty | readonly boolean | Whether it's playing (not held), as of the last frame. |
timeproperty | readonly number | Where it is in its sound, seconds. |
Methods
| Signature | Description |
|---|---|
play(): voidmethod | Plays it from its start. |
stop(): voidmethod | Stops it. |
pause(): voidmethod | Holds it where it is. |
resume(): voidmethod | Plays it on from where it was held. |
setVolume(volume: number): voidmethod | Turns it up or down, over its own volume. |
setPan(pan: number): voidmethod | Pans it. |
fadeTo(volume: number, seconds: number): voidmethod | Moves its volume to a new one over seconds. |
Notes from the community
Written by creators and checked by the docs' editors. Not part of Motion's official reference.