AudioGraphNode.setParams() method

Apply a runtime parameter update to a node in the graph, addressed by the handle returned when it was built (hoist it out of the build closure to keep a reference). An optional PartTransition ramps the change so it is click-free. Only parameters the target op supports take effect (a gain node reads db).

Signature:

setParams(node: AudioNode, update: AudioGraphParamsUpdate): void;

Parameters

Parameter Type Description

node

AudioNode

update

AudioGraphParamsUpdate

Returns:

void

Example

let vol: AudioNode;
const graph = await norsk.processor.transform.audioGraph({
  build: (g) => (vol = g.gain(g.input, { db: -6 })),
});
graph.setParams(vol, { db: -3, transition: { durationMs: 200 } });