<!DOCTYPE html>
<html>
<head>
<title>
Test performance of 100 DynamicsCompressorNodes (post-knee).
</title>
<script src="../resources/runner.js"></script>
<script src="resources/webaudio-perf-utils.js"></script>
</head>
<body>
<script>
function graphBuilder() {
const context = new OfflineAudioContext(1, 48000, 48000);
// Use very large offset to ensure we are post-knee
const source = new ConstantSourceNode(context, {offset: 100});
const testNodes = createNodes(
context, 'DynamicsCompressorNode', 100,
{attack: .003, knee: 30, ratio: 12, release: .25, threshold: -24});
for (let i = 0; i < testNodes.length; ++i) {
source.connect(testNodes[i]);
testNodes[i].connect(context.destination);
}
source.start();
return context;
}
RunWebAudioPerfTest({
description: 'Test performance of 100 DynamicsCompressorNodes',
graphBuilder: graphBuilder,
tracingOptions: {
targetCategory: 'disabled-by-default-webaudio.audionode',
targetEvents: ['DynamicsCompressorHandler::Process'],
}
});
</script>
</body>
</html>