standardized-audio-context
Version:
A cross-browser wrapper for the Web Audio API which aims to closely follow the standard.
12 lines • 727 B
JavaScript
export const wrapAudioScheduledSourceNodeStartMethodNegativeParameters = (nativeAudioScheduledSourceNode) => {
nativeAudioScheduledSourceNode.start = ((start) => {
return (when = 0, offset = 0, duration) => {
if ((typeof duration === 'number' && duration < 0) || offset < 0 || when < 0) {
throw new RangeError("The parameters can't be negative.");
}
// @todo TypeScript cannot infer the overloaded signature with 3 arguments yet.
start.call(nativeAudioScheduledSourceNode, when, offset, duration);
};
})(nativeAudioScheduledSourceNode.start);
};
//# sourceMappingURL=wrap-audio-scheduled-source-node-start-method-negative-parameters.js.map