Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /webaudio/the-audio-api/the-dynamicscompressornode-interface/dynamicscompressor-basic.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<title>
dynamicscompressor-basic.html
</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/webaudio/resources/audit-util.js"></script>
<script src="/webaudio/resources/audit.js"></script>
</head>
<body>
<script id="layout-test-code">
let audit = Audit.createTaskRunner();
let context;
let compressor;
audit.define(
{
label: 'test',
description: 'Basic tests for DynamicsCompressorNode API'
},
function(task, should) {
context = new AudioContext();
compressor = context.createDynamicsCompressor();
should(compressor.threshold.value, 'compressor.threshold.value')
.beEqualTo(-24);
should(compressor.knee.value, 'compressor.knee.value')
.beEqualTo(30);
should(compressor.ratio.value, 'compressor.ratio.value')
.beEqualTo(12);
should(compressor.attack.value, 'compressor.attack.value')
.beEqualTo(Math.fround(0.003));
should(compressor.release.value, 'compressor.release.value')
.beEqualTo(0.25);
should(typeof compressor.reduction, 'typeof compressor.reduction')
.beEqualTo('number');
should(compressor.reduction, 'compressor.reduction').beEqualTo(0);
task.done();
});
audit.run();
</script>
</body>
</html>