blob: 34f5cd20644a49647b77974560e338796c077219 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>
Validate Reduction Value of DynamicsComporessor after Disabling
</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../resources/audit-util.js"></script>
<script src="../resources/audit.js"></script>
</head>
<body>
<script id="layout-test-code">
let audit = Audit.createTaskRunner();
let context;
let buffer;
let source;
let compressor;
let sampleRate = 44100;
let testDurationSamples = 44100;
audit.define(
{
label: 'test',
description:
'Validate Reduction Value of DynamicsCompressor after Disabling'
},
function(task, should) {
// Create the offline context for the test.
context =
new OfflineAudioContext(1, testDurationSamples, sampleRate);
// Create the constant sample buffer of 0.5 sec.
buffer = createConstantBuffer(context, testDurationSamples / 2, 1);
// Create compressor and use default parameters for the compression.
compressor = context.createDynamicsCompressor();
// Create the source and connect it to the destination
source = context.createBufferSource();
source.buffer = buffer;
source.connect(compressor);
compressor.connect(context.destination);
source.start(0.0);
// Render it!
context.startRendering().then(() => {
// Check that the reduction value is 0.0.
should(compressor.reduction, 'compressor.reduction').beEqualTo(0);
task.done();
});
});
audit.run();
</script>
</body>
</html>