Motion
Get Motion

ReferenceScripting APIMotionVoice

MotionVoice

interface

One playing of a sound: turned, panned, sped, moved, stopped, or crossed over to another sound. Read it with its properties, change it with its methods.

NameMotionVoice
Kindinterface
Script reaches it asMotionSound.play()
Since0.3

Syntax

interface MotionVoice { … }

Properties

NameTypeDescription
idpropertyreadonly numberIts number.
playingpropertyreadonly booleanWhether it's still playing (as of the last frame).
volumepropertyreadonly numberIts volume, 0 to 2.
panpropertyreadonly numberIts pan, -1 left to 1 right.
ratepropertyreadonly numberIts speed, 0.25 to 4 (faster is higher).
positionpropertyreadonly numberWhere it is in its sound, seconds (as of the last frame).
endedpropertyreadonly Promise<void>A promise of its ending: played out, or stopped.

Methods

SignatureDescription
stop(options?: { fadeOut?: number }): voidmethodStops it, at once or fading out.
setVolume(volume: number): voidmethodTurns it up or down.
setPan(pan: number): voidmethodPans it.
setRate(rate: number): voidmethodPlays it faster (and higher) or slower.
seek(seconds: number): voidmethodMoves it to a place in its sound.
crossfadeTo(other: MotionSound, seconds: number): MotionVoicemethodFades this voice out as another sound fades in, over seconds.