StreamSwitchSmoothSettings.onInboundContextChange property
Callback to be called when inbound context changes on some input; presence of an input means that media has arrived and is ready to switch immediately
The switch is stopped while this runs: nothing from the new context has been output yet, and nothing will be until the returned promise settles. A StreamSwitchSmoothNode.switchSource() made before it settles takes effect on exactly the first frame of the new context, picture and sound together.
That is exact within this node only. To change something in another node at the same point - gains in a separate AudioMixNode, for one - make that change in the other node’s own callback, not from this one; see AudioMixSettings.onInboundContextChange for the pattern.
Signature:
onInboundContextChange?: (allStreams: Map<Pins, StreamMetadata[]>) => Promise<void>;