Skip to content

anim-format (runtime format) / soundEnvelope

Function: soundEnvelope() ​

ts
function soundEnvelope(
   opts, 
   t, 
   total, 
   loopLength?
): object;

Gain (0..1, volume included) and stereo pan (-1 left … 1 right) at t seconds into a play lasting total seconds (Infinity = forever: no fade out; the pans sweep once per loop of loopLength).

Parameters ​

ParameterTypeDefault value
optsSoundOptionsundefined
tnumberundefined
totalnumberundefined
loopLength?numbertotal

Returns ​

object

NameType
gainnumber
pannumber

HereSplash — 2D animation for the web