@motion-script/core / AudioFilterChain
Class: AudioFilterChain
Defined in: attributes/audio/filters/chain.ts:85
Immutable, chainable list of audio filters.
Each builder method returns a new AudioFilterChain with the filter appended,
so chains are safe to share and branch. Filters apply in array order
(index 0 is closest to the source).
Every numeric param accepts either a constant number or a time-varying
Param curve (see ramp/fadeIn/fadeOut), so any filter can animate:
Example
const chain = AudioFilters.gain(1.5).lowpass(800).echo(0.3);
this.playSound('song.mp3', { filters: chain }); // assign directly
this.playSound('song.mp3', { filters: AudioFilters.volume(fadeIn(0.5).fadeOut(1)) }); // animated
Constructors
Constructor
new AudioFilterChain(
list?):AudioFilterChain
Defined in: attributes/audio/filters/chain.ts:86
Parameters
list?
AudioFilterItem[] = []
Returns
AudioFilterChain
Properties
list
list:
AudioFilterItem[] =[]
Defined in: attributes/audio/filters/chain.ts:86
Methods
[iterator]()
[iterator]():
Generator<AudioFilterItem,void,unknown>
Defined in: attributes/audio/filters/chain.ts:134
Allows spreading the chain into an array: [...AudioFilters.gain(2)].
Returns
Generator<AudioFilterItem, void, unknown>
echo()
echo(
options):AudioFilterChain
Defined in: attributes/audio/filters/chain.ts:128
Append an echo; delay seconds, feedback 0–<1, optional wet mix 0–1.
Parameters
options
Returns
AudioFilterChain
gain()
gain(
options):AudioFilterChain
Defined in: attributes/audio/filters/chain.ts:93
Append a gain (volume) filter.
Parameters
options
Returns
AudioFilterChain
highpass()
highpass(
options):AudioFilterChain
Defined in: attributes/audio/filters/chain.ts:104
Append a high-pass filter; rolls off content below frequency Hz.
Parameters
options
Returns
AudioFilterChain
lowpass()
lowpass(
options):AudioFilterChain
Defined in: attributes/audio/filters/chain.ts:110
Append a low-pass filter; rolls off content above frequency Hz.
Parameters
options
Returns
AudioFilterChain
speed()
speed(
options):AudioFilterChain
Defined in: attributes/audio/filters/chain.ts:122
Append a speed change; the playback-rate multiplier (alters pitch).
Parameters
options
Returns
AudioFilterChain
toJSON()
toJSON():
AudioFilterItem[]
Defined in: attributes/audio/filters/chain.ts:139
Serializes to the raw filter array so frameworks that call toJSON get a plain value.
Returns
tremolo()
tremolo(
options):AudioFilterChain
Defined in: attributes/audio/filters/chain.ts:116
Append a tremolo; rate Hz wobble at depth (0–1) modulation depth.
Parameters
options
Returns
AudioFilterChain
volume()
volume(
options):AudioFilterChain
Defined in: attributes/audio/filters/chain.ts:99
Alias for gain; reads naturally for volume automation (volume(fadeIn(0.5))).
Parameters
options
Returns
AudioFilterChain