standardized-audio-context
Version:
A cross-browser wrapper for the Web Audio API which aims to closely follow the standard.
16 lines • 930 B
JavaScript
export const sanitizeAudioWorkletNodeOptions = (options) => {
return {
...options,
outputChannelCount: options.outputChannelCount !== undefined
? options.outputChannelCount
: options.numberOfInputs === 1 && options.numberOfOutputs === 1
? /*
* Bug #61: This should be the computedNumberOfChannels, but unfortunately that is almost impossible to fake. That's why
* the channelCountMode is required to be 'explicit' as long as there is not a native implementation in every browser. That
* makes sure the computedNumberOfChannels is equivilant to the channelCount which makes it much easier to compute.
*/
[options.channelCount]
: Array.from({ length: options.numberOfOutputs }, () => 1)
};
};
//# sourceMappingURL=sanitize-audio-worklet-node-options.js.map