mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-05 08:31:51 +00:00
For now, this slot is always 0 - (the default value per spec). But once we start actually processing audio streams this internal slot should be changed correspondingly.
30 lines
988 B
HTML
30 lines
988 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
function dumpAudioParam(param) {
|
|
println(`${param} current: ${param.value}, default: ${param.defaultValue}, min: ${param.minValue}, max: ${param.maxValue}, rate: ${param.automationRate}`);
|
|
}
|
|
|
|
test(() => {
|
|
const audioContext = new OfflineAudioContext(1, 5000, 44100);
|
|
|
|
const compressor = audioContext.createDynamicsCompressor();
|
|
|
|
// Check prototype
|
|
let prototype = Object.getPrototypeOf(compressor);
|
|
|
|
while (prototype) {
|
|
println(prototype.constructor.name);
|
|
prototype = Object.getPrototypeOf(prototype);
|
|
}
|
|
|
|
// Audio Params
|
|
dumpAudioParam(compressor.threshold);
|
|
dumpAudioParam(compressor.knee);
|
|
dumpAudioParam(compressor.ratio);
|
|
dumpAudioParam(compressor.attack);
|
|
dumpAudioParam(compressor.release);
|
|
|
|
// Default reduction
|
|
println(`reduction: ${compressor.reduction}`);
|
|
});
|
|
</script>
|