Here is a list of the standard virtual audio node factories exported by virtual-audio-graph and the params you can provide them with (the virtual-audio-graph guide is here).
analyser(output, {
fftSize,
minDecibels,
maxDecibels,
smoothingTimeConstant,
}]
const {
audioContext,
audioContext: { sampleRate },
} = virtualAudioGraph;
const buffer = audioContext.createBuffer(2, sampleRate * 2, sampleRate);
bufferSource(output, {
buffer,
loop,
loopEnd,
loopStart,
// The offset parameter, which defaults to 0
// and defines where the playback will start
offsetTime,
onended,
playbackRate,
// time in seconds since virtualAudioGraph.currentTime
// was 0, if not provided then node starts immediately
startTime,
// if not provided then stop is not called on node
// until it is disconnected
stopTime,
});
biquadFilter(output, { type, frequency, detune, Q });
channelMerger(output, { numberOfInputs });
NB ChannelSplitter has it's own syntax for the output parameter. Because the channel is split it means each node can have multiple outputs. Each output is indexed and the outputs property should be an array of these indices. Then the inputs property should be an array of indices corresponding to the inputs of the destination node. Check out the spec and the link above for more info.
channelSplitter({ key, outputs, inputs }, { numberOfOutputs });
convolver(output, { buffer, normalize });
NB maxDelayTime must be set when node is first created but cannot be updated. A new node will have to be inserted if a different maxDelayTime is required.
delay(output, { delayTime, maxDelayTime });
dynamicsCompressor(output, {
attack,
knee,
ratio,
release,
threshold,
}]
gain(output, { gain });
NB params can only be set once
mediaElementSource(output, { mediaElement });
This node has no output as it is a destination. It also takes no parameters. Use virtualAudioGraph.getAudioNodeById method to access the node's stream property
mediaStreamDestination();
NB params can only be set once
mediaStreamSource(output, { mediaStream });
oscillator(output, {
type,
frequency,
detune,
// time in seconds since virtualAudioGraph.currentTime
// was 0, if not provided then node starts immediately
startTime,
// if not provided then stop is not called on node until it is disconnected
stopTime,
});
panner(output, {
coneInnerAngle,
coneOuterAngle,
coneOuterGain,
distanceModel,
// applies an array of arguments with the corresponding AudioNode setter:
orientation,
panningModel,
// applies an array of arguments with the corresponding AudioNode setter:
position,
maxDistance,
refDistance,
rolloffFactor,
});
stereoPanner(output, { pan });
waveShaper(output, { curve, oversample });