Skip to content

Truly independent web browser

LibWeb: Implement IIRFilterNode and WaveShaperNode

Andreas Kling4cbf25df7ab0
diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt
index dbcc1d94935..bfb0d4e363a 100644
--- a/Libraries/LibWeb/CMakeLists.txt
+++ b/Libraries/LibWeb/CMakeLists.txt
@@ -1019,6 +1019,7 @@ set(SOURCES
WebAudio/DelayNode.cpp
WebAudio/DynamicsCompressorNode.cpp
WebAudio/GainNode.cpp
+ WebAudio/IIRFilterNode.cpp
WebAudio/MediaElementAudioSourceNode.cpp
WebAudio/MediaStreamAudioDestinationNode.cpp
WebAudio/MediaStreamAudioSourceNode.cpp
@@ -1043,6 +1044,7 @@ set(SOURCES
WebAudio/Rendering/RenderNodes.cpp
WebAudio/ScriptProcessorNode.cpp
WebAudio/StereoPannerNode.cpp
+ WebAudio/WaveShaperNode.cpp
WebDriver/Actions.cpp
WebDriver/Contexts.cpp
WebDriver/ElementLocationStrategies.cpp
diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp b/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp
index f439e56f461..7623e2d6740 100644
--- a/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp
+++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp
@@ -261,6 +261,16 @@ WebIDL::ExceptionOr<GC::Ref<GainNode>> BaseAudioContext::create_gain()
return GainNode::create(*this);
}
+// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createiirfilter
+WebIDL::ExceptionOr<GC::Ref<IIRFilterNode>> BaseAudioContext::create_iir_filter(Vector<double> const& feedforward, Vector<double> const& feedback)
+{
+ // Factory method for an IIRFilterNode representing a general IIR Filter.
+ IIRFilterOptions options;
+ options.feedforward = feedforward;
+ options.feedback = feedback;
+ return IIRFilterNode::create(*this, options);
+}
+
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createpanner
WebIDL::ExceptionOr<GC::Ref<PannerNode>> BaseAudioContext::create_panner()
{
@@ -409,6 +419,13 @@ WebIDL::ExceptionOr<GC::Ref<StereoPannerNode>> BaseAudioContext::create_stereo_p
return StereoPannerNode::create(*this);
}
+// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createwaveshaper
+WebIDL::ExceptionOr<GC::Ref<WaveShaperNode>> BaseAudioContext::create_wave_shaper()
+{
+ // Factory method for a WaveShaperNode representing a non-linear distortion.
+ return WaveShaperNode::create(*this);
+}
+
WebIDL::ExceptionOr<void> BaseAudioContext::verify_audio_options_inside_nominal_range(float sample_rate)
{
if (sample_rate < MIN_SAMPLE_RATE || sample_rate > MAX_SAMPLE_RATE)
diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.h b/Libraries/LibWeb/WebAudio/BaseAudioContext.h
index 4db65f036c7..00fc020e4dc 100644
--- a/Libraries/LibWeb/WebAudio/BaseAudioContext.h
+++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.h
@@ -22,10 +22,12 @@
#include <LibWeb/WebAudio/ControlMessageQueue.h>
#include <LibWeb/WebAudio/ConvolverNode.h>
#include <LibWeb/WebAudio/DelayNode.h>
+#include <LibWeb/WebAudio/IIRFilterNode.h>
#include <LibWeb/WebAudio/PeriodicWave.h>
#include <LibWeb/WebAudio/ScriptProcessorNode.h>
#include <LibWeb/WebAudio/StereoPannerNode.h>
#include <LibWeb/WebAudio/Types.h>
+#include <LibWeb/WebAudio/WaveShaperNode.h>
#include <LibWebCommon/WebIDL/Types.h>
namespace Web::WebIDL {
@@ -109,6 +111,7 @@ public:
WebIDL::ExceptionOr<GC::Ref<OscillatorNode>> create_oscillator();
WebIDL::ExceptionOr<GC::Ref<DynamicsCompressorNode>> create_dynamics_compressor();
WebIDL::ExceptionOr<GC::Ref<GainNode>> create_gain();
+ WebIDL::ExceptionOr<GC::Ref<IIRFilterNode>> create_iir_filter(Vector<double> const& feedforward, Vector<double> const& feedback);
WebIDL::ExceptionOr<GC::Ref<PannerNode>> create_panner();
WebIDL::ExceptionOr<GC::Ref<PeriodicWave>> create_periodic_wave(Vector<float> const& real, Vector<float> const& imag, PeriodicWaveConstraints const& constraints = {});
WebIDL::ExceptionOr<GC::Ref<ScriptProcessorNode>> create_script_processor(
@@ -116,6 +119,7 @@ public:
WebIDL::UnsignedLong number_of_input_channels,
WebIDL::UnsignedLong number_of_output_channels);
WebIDL::ExceptionOr<GC::Ref<StereoPannerNode>> create_stereo_panner();
+ WebIDL::ExceptionOr<GC::Ref<WaveShaperNode>> create_wave_shaper();
WebIDL::ExceptionOr<void> decode_audio_data(GC::Ref<WebIDL::Promise>, ByteBuffer, GC::Ptr<WebIDL::CallbackType>, GC::Ptr<WebIDL::CallbackType>);
WebIDL::ExceptionOr<GC::Ref<WebIDL::Promise>> decode_audio_data(JS::Realm&, GC::Ref<JS::ArrayBuffer>, GC::Ptr<WebIDL::CallbackType>, GC::Ptr<WebIDL::CallbackType>);
diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.idl b/Libraries/LibWeb/WebAudio/BaseAudioContext.idl
index 7d4d6db2d32..247f2ec0a09 100644
--- a/Libraries/LibWeb/WebAudio/BaseAudioContext.idl
+++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.idl
@@ -29,13 +29,13 @@ interface BaseAudioContext : EventTarget {
DelayNode createDelay (optional double maxDelayTime = 1.0);
DynamicsCompressorNode createDynamicsCompressor();
GainNode createGain();
- [FIXME] IIRFilterNode createIIRFilter (sequence<double> feedforward, sequence<double> feedback);
+ IIRFilterNode createIIRFilter (sequence<double> feedforward, sequence<double> feedback);
OscillatorNode createOscillator();
PannerNode createPanner();
PeriodicWave createPeriodicWave (sequence<float> real, sequence<float> imag, optional PeriodicWaveConstraints constraints = {});
ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0, optional unsigned long numberOfInputChannels = 2, optional unsigned long numberOfOutputChannels = 2);
StereoPannerNode createStereoPanner ();
- [FIXME] WaveShaperNode createWaveShaper ();
+ WaveShaperNode createWaveShaper ();
Promise<AudioBuffer> decodeAudioData (ArrayBuffer audioData, optional DecodeSuccessCallback? successCallback, optional DecodeErrorCallback? errorCallback);
};
diff --git a/Libraries/LibWeb/WebAudio/IIRFilterNode.cpp b/Libraries/LibWeb/WebAudio/IIRFilterNode.cpp
new file mode 100644
index 00000000000..428855ee050
--- /dev/null
+++ b/Libraries/LibWeb/WebAudio/IIRFilterNode.cpp
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2026-present, the Ladybird developers.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <AK/Math.h>
+#include <LibGC/Heap.h>
+#include <LibJS/Runtime/TypedArray.h>
+#include <LibWeb/WebAudio/AudioArray.h>
+#include <LibWeb/WebAudio/BaseAudioContext.h>
+#include <LibWeb/WebAudio/IIRFilterNode.h>
+#include <LibWeb/WebAudio/Rendering/RenderNodes.h>
+#include <LibWeb/WebIDL/DOMException.h>
+
+namespace Web::WebAudio {
+
+GC_DEFINE_ALLOCATOR(IIRFilterNode);
+
+// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createiirfilter
+static constexpr size_t max_coefficient_count = 20;
+
+IIRFilterNode::IIRFilterNode(GC::Ref<BaseAudioContext> context, Vector<double> feedforward, Vector<double> feedback)
+ : AudioNode(context)
+ , m_feedforward(move(feedforward))
+ , m_feedback(move(feedback))
+{
+}
+
+IIRFilterNode::~IIRFilterNode() = default;
+
+WebIDL::ExceptionOr<GC::Ref<IIRFilterNode>> IIRFilterNode::create(GC::Ref<BaseAudioContext> context, IIRFilterOptions const& options)
+{
+ // https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createiirfilter
+ // feedforward: An array of the feedforward (numerator) coefficients for the transfer function of the IIR filter.
+ // The maximum length of this array is 20. If all of the values are zero, an InvalidStateError MUST be thrown. A
+ // NotSupportedError MUST be thrown if the array length is 0 or greater than 20.
+ // feedback: An array of the feedback (denominator) coefficients for the transfer function of the IIR filter. The
+ // maximum length of this array is 20. If the first element of the array is 0, an InvalidStateError MUST be thrown.
+ // A NotSupportedError MUST be thrown if the array length is 0 or greater than 20.
+ auto const& feedforward = options.feedforward;
+ auto const& feedback = options.feedback;
+ if (feedforward.is_empty() || feedforward.size() > max_coefficient_count)
+ return WebIDL::NotSupportedError::create("The number of feedforward coefficients must be between 1 and 20"_utf16);
+ if (feedback.is_empty() || feedback.size() > max_coefficient_count)
+ return WebIDL::NotSupportedError::create("The number of feedback coefficients must be between 1 and 20"_utf16);
+ if (all_of(feedforward, [](double coefficient) { return coefficient == 0; }))
+ return WebIDL::InvalidStateError::create("At least one feedforward coefficient must not be zero"_utf16);
+ if (feedback.first() == 0)
+ return WebIDL::InvalidStateError::create("The first feedback coefficient must not be zero"_utf16);
+
+ // https://webaudio.github.io/web-audio-api/#IIRFilterNode-filter-definition
+ // NB: Dividing every coefficient by a_0 gives the same transfer function with a_0 = 1, which the filter uses.
+ auto a0 = feedback.first();
+ Vector<double> normalized_feedforward;
+ normalized_feedforward.ensure_capacity(feedforward.size());
+ for (auto coefficient : feedforward)
+ normalized_feedforward.unchecked_append(coefficient / a0);
+ Vector<double> normalized_feedback;
+ normalized_feedback.ensure_capacity(feedback.size());
+ for (auto coefficient : feedback)
+ normalized_feedback.unchecked_append(coefficient / a0);
+
+ // When the constructor is called with a BaseAudioContext c and an option object option, the user agent MUST
+ // initialize the AudioNode this, with context and options as arguments.
+ auto node = GC::Heap::the().allocate<IIRFilterNode>(context, normalized_feedforward, normalized_feedback);
+
+ // https://webaudio.github.io/web-audio-api/#IIRFilterNode
+ AudioNodeDefaultOptions default_options;
+ default_options.channel_count_mode = ChannelCountMode::Max;
+ default_options.channel_interpretation = ChannelInterpretation::Speakers;
+ default_options.channel_count = 2;
+ // FIXME: Set tail-time to yes
+
+ TRY(node->initialize_audio_node_options(options, default_options));
+
+ node->queue_render_node_creation(make<Rendering::IIRFilterRenderNode>(node->node_id(), BaseAudioContext::render_quantum_size(), move(normalized_feedforward), move(normalized_feedback)));
+
+ return node;
+}
+
+// https://webaudio.github.io/web-audio-api/#dom-iirfilternode-iirfilternode
+WebIDL::ExceptionOr<GC::Ref<IIRFilterNode>> IIRFilterNode::create_for_constructor(GC::Ref<BaseAudioContext> context, IIRFilterOptions const& options)
+{
+ return create(context, options);
+}
+
+// https://webaudio.github.io/web-audio-api/#dom-iirfilternode-getfrequencyresponse
+WebIDL::ExceptionOr<void> IIRFilterNode::get_frequency_response(GC::Ref<JS::Float32Array> frequency_hz, GC::Ref<JS::Float32Array> mag_response, GC::Ref<JS::Float32Array> phase_response)
+{
+ // Given the current filter parameter settings, synchronously calculates the frequency response for the specified
+ // frequencies. The three parameters MUST be Float32Arrays of the same length, or an InvalidAccessError MUST be
+ // thrown.
+ auto length = float32_array_length(*frequency_hz);
+ if (float32_array_length(*mag_response) != length || float32_array_length(*phase_response) != length)
+ return WebIDL::InvalidAccessError::create(context()->relevant_settings_object().realm(), "Arrays must have the same length"_utf16);
+
+ auto frequencies = copy_float32_array(*frequency_hz);
+ Vector<float> magnitudes;
+ magnitudes.resize(length);
+ Vector<float> phases;
+ phases.resize(length);
+
+ auto nyquist_frequency = context()->nyquist_frequency();
+
+ // https://webaudio.github.io/web-audio-api/#IIRFilterNode-filter-definition
+ // NB: H(z) = (sum_{m=0}^{M} b_m z^{-m}) / (sum_{n=0}^{N} a_n z^{-n}), evaluated at z = e^{j omega}. A polynomial in
+ // z^-1 is evaluated with Horner's method, from the coefficient of its highest power down.
+ struct ComplexNumber {
+ double real { 0 };
+ double imaginary { 0 };
+ };
+ auto evaluate = [](ReadonlySpan<double> coefficients, ComplexNumber z_inverse) {
+ ComplexNumber result;
+ for (size_t index = coefficients.size(); index-- > 0;) {
+ result = {
+ result.real * z_inverse.real - result.imaginary * z_inverse.imaginary + coefficients[index],
+ result.real * z_inverse.imaginary + result.imaginary * z_inverse.real,
+ };
+ }
+ return result;
+ };
+
+ for (size_t index = 0; index < length; ++index) {
+ double frequency = frequencies[index];
+
+ // If a value in the frequencyHz parameter is not within [0, sampleRate/2], where sampleRate is the value of
+ // the sampleRate property of the AudioContext, the corresponding value at the same index of the magResponse
+ // and phaseResponse arrays MUST be NaN.
+ if (isnan(frequency) || frequency < 0 || frequency > nyquist_frequency) {
+ magnitudes[index] = NAN;
+ phases[index] = NAN;
+ continue;
+ }
+
+ double omega = AK::Pi<double> * frequency / nyquist_frequency;
+ ComplexNumber z_inverse { AK::cos(omega), -AK::sin(omega) };
+ auto numerator = evaluate(m_feedforward, z_inverse);
+ auto denominator = evaluate(m_feedback, z_inverse);
+ auto denominator_magnitude_squared = denominator.real * denominator.real + denominator.imaginary * denominator.imaginary;
+ ComplexNumber response {
+ (numerator.real * denominator.real + numerator.imaginary * denominator.imaginary) / denominator_magnitude_squared,
+ (numerator.imaginary * denominator.real - numerator.real * denominator.imaginary) / denominator_magnitude_squared,
+ };
+ magnitudes[index] = static_cast<float>(AK::hypot(response.real, response.imaginary));
+ phases[index] = static_cast<float>(AK::atan2(response.imaginary, response.real));
+ }
+
+ overwrite_float32_array(*mag_response, magnitudes);
+ overwrite_float32_array(*phase_response, phases);
+ return {};
+}
+
+}
diff --git a/Libraries/LibWeb/WebAudio/IIRFilterNode.h b/Libraries/LibWeb/WebAudio/IIRFilterNode.h
new file mode 100644
index 00000000000..8e5e045b11d
--- /dev/null
+++ b/Libraries/LibWeb/WebAudio/IIRFilterNode.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2026-present, the Ladybird developers.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <AK/Vector.h>
+#include <LibWeb/Bindings/IIRFilterNode.h>
+#include <LibWeb/WebAudio/AudioNode.h>
+
+namespace Web::WebAudio {
+
+using IIRFilterOptions = Bindings::IIRFilterOptions;
+
+// https://webaudio.github.io/web-audio-api/#IIRFilterNode
+class IIRFilterNode final : public AudioNode {
+ WEB_WRAPPABLE(IIRFilterNode, AudioNode);
+ GC_DECLARE_ALLOCATOR(IIRFilterNode);
+
+public:
+ virtual ~IIRFilterNode() override;
+
+ static WebIDL::ExceptionOr<GC::Ref<IIRFilterNode>> create(GC::Ref<BaseAudioContext>, IIRFilterOptions const&);
+ static WebIDL::ExceptionOr<GC::Ref<IIRFilterNode>> create_for_constructor(GC::Ref<BaseAudioContext>, IIRFilterOptions const&);
+
+ WebIDL::UnsignedLong number_of_inputs() override { return 1; }
+ WebIDL::UnsignedLong number_of_outputs() override { return 1; }
+
+ WebIDL::ExceptionOr<void> get_frequency_response(GC::Ref<JS::Float32Array> frequency_hz, GC::Ref<JS::Float32Array> mag_response, GC::Ref<JS::Float32Array> phase_response);
+
+private:
+ IIRFilterNode(GC::Ref<BaseAudioContext>, Vector<double> feedforward, Vector<double> feedback);
+
+ // The coefficients, divided by the first feedback coefficient.
+ Vector<double> m_feedforward;
+ Vector<double> m_feedback;
+};
+
+}
diff --git a/Libraries/LibWeb/WebAudio/IIRFilterNode.idl b/Libraries/LibWeb/WebAudio/IIRFilterNode.idl
new file mode 100644
index 00000000000..22fe6f6f249
--- /dev/null
+++ b/Libraries/LibWeb/WebAudio/IIRFilterNode.idl
@@ -0,0 +1,12 @@
+// https://webaudio.github.io/web-audio-api/#IIRFilterOptions
+dictionary IIRFilterOptions : AudioNodeOptions {
+ required sequence<double> feedforward;
+ required sequence<double> feedback;
+};
+
+// https://webaudio.github.io/web-audio-api/#IIRFilterNode
+[Exposed=Window]
+interface IIRFilterNode : AudioNode {
+ constructor (BaseAudioContext context, IIRFilterOptions options);
+ undefined getFrequencyResponse (Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse);
+};
diff --git a/Libraries/LibWeb/WebAudio/Rendering/AudioData.h b/Libraries/LibWeb/WebAudio/Rendering/AudioData.h
index 4298003a3a0..28f902cc39b 100644
--- a/Libraries/LibWeb/WebAudio/Rendering/AudioData.h
+++ b/Libraries/LibWeb/WebAudio/Rendering/AudioData.h
@@ -28,6 +28,17 @@ struct AudioBufferContents : public AtomicRefCounted<AudioBufferContents> {
float sample_rate { 0 };
};
+// An immutable copy of a WaveShaperNode's curve.
+// https://webaudio.github.io/web-audio-api/#dom-waveshapernode-curve
+struct WaveShaperCurve : public AtomicRefCounted<WaveShaperCurve> {
+ explicit WaveShaperCurve(Vector<float> values)
+ : values(move(values))
+ {
+ }
+
+ Vector<float> values;
+};
+
// An immutable snapshot of a PeriodicWave's Fourier coefficients.
// https://webaudio.github.io/web-audio-api/#PeriodicWave
struct PeriodicWaveData : public AtomicRefCounted<PeriodicWaveData> {
diff --git a/Libraries/LibWeb/WebAudio/Rendering/NodeMessage.h b/Libraries/LibWeb/WebAudio/Rendering/NodeMessage.h
index 9c27ea08820..a872da69fc0 100644
--- a/Libraries/LibWeb/WebAudio/Rendering/NodeMessage.h
+++ b/Libraries/LibWeb/WebAudio/Rendering/NodeMessage.h
@@ -14,6 +14,7 @@
#include <LibWeb/Bindings/BiquadFilterNode.h>
#include <LibWeb/Bindings/OscillatorNode.h>
#include <LibWeb/Bindings/PannerNode.h>
+#include <LibWeb/Bindings/WaveShaperNode.h>
#include <LibWeb/WebAudio/Rendering/AudioData.h>
#include <LibWeb/WebAudio/Rendering/ConvolverKernel.h>
#include <LibWeb/WebAudio/Types.h>
@@ -78,6 +79,12 @@ struct SetPannerParameters {
double cone_outer_gain { 0 };
};
+struct SetWaveShaperParameters {
+ NodeID node_id { 0 };
+ RefPtr<Rendering::WaveShaperCurve> curve;
+ Bindings::OverSampleType oversample { Bindings::OverSampleType::None };
+};
+
// Attaches the ring buffer that carries a MediaStreamTrack's audio into a
// MediaStreamAudioSourceNode's render node. Shipped as a message rather than a constructor
// argument so the ring can be replaced without rebuilding the render node.
@@ -95,6 +102,7 @@ using NodeMessage = Variant<
SetMediaStreamSourceRing,
SetOscillatorWaveform,
SetPannerParameters,
+ SetWaveShaperParameters,
StartBufferSource,
StartSource,
StopSource>;
diff --git a/Libraries/LibWeb/WebAudio/Rendering/RenderNodes.cpp b/Libraries/LibWeb/WebAudio/Rendering/RenderNodes.cpp
index 11a32446d0b..692dfee294d 100644
--- a/Libraries/LibWeb/WebAudio/Rendering/RenderNodes.cpp
+++ b/Libraries/LibWeb/WebAudio/Rendering/RenderNodes.cpp
@@ -607,6 +607,214 @@ void BiquadFilterRenderNode::process(RenderGraph& graph, RenderContext const& co
}
}
+IIRFilterRenderNode::IIRFilterRenderNode(NodeID node_id, size_t quantum_size, Vector<double> feedforward, Vector<double> feedback)
+ : RenderNode(node_id, 1, 1, quantum_size)
+ , m_feedforward(move(feedforward))
+ , m_feedback(move(feedback))
+{
+ VERIFY(m_feedforward.size() < history_size);
+ VERIFY(m_feedback.size() < history_size);
+}
+
+void IIRFilterRenderNode::process(RenderGraph& graph, RenderContext const& context)
+{
+ auto const& input = pull_input(graph, context, 0);
+
+ // The number of channels of the output always equals the number of channels of the input.
+ auto& filter_output = output(0);
+ filter_output.set_channel_count(input.channel_count());
+ if (m_filter_states.size() != input.channel_count())
+ m_filter_states.resize(input.channel_count());
+
+ // https://webaudio.github.io/web-audio-api/#IIRFilterNode-filter-definition
+ // sum_{k=0}^{N} a_k y(n-k) = sum_{k=0}^{M} b_k x(n-k), where a_0 is 1 as the coefficients are normalized.
+ static constexpr size_t history_mask = history_size - 1;
+ for (size_t channel_index = 0; channel_index < input.channel_count(); ++channel_index) {
+ auto& state = m_filter_states[channel_index];
+ auto input_samples = input.channel(channel_index);
+ auto output_samples = filter_output.channel(channel_index);
+ auto position = m_position;
+ for (size_t frame = 0; frame < context.quantum_size; ++frame, ++position) {
+ double x = input_samples[frame];
+ double y = m_feedforward[0] * x;
+ for (size_t k = 1; k < m_feedforward.size(); ++k)
+ y += m_feedforward[k] * state.inputs[(position - k) & history_mask];
+ for (size_t k = 1; k < m_feedback.size(); ++k)
+ y -= m_feedback[k] * state.outputs[(position - k) & history_mask];
+ // NB: A decaying output would otherwise settle on subnormal numbers, which are slow to compute with.
+ if (AK::fabs(y) < NumericLimits<double>::min_normal())
+ y = 0;
+ state.inputs[position & history_mask] = x;
+ state.outputs[position & history_mask] = y;
+ output_samples[frame] = static_cast<float>(y);
+ }
+ }
+ m_position += context.quantum_size;
+}
+
+WaveShaperRenderNode::WaveShaperRenderNode(NodeID node_id, size_t quantum_size)
+ : RenderNode(node_id, 1, 1, quantum_size)
+{
+ m_two_times_samples.resize(quantum_size * 2);
+ m_four_times_samples.resize(quantum_size * 4);
+}
+
+void WaveShaperRenderNode::handle_message(NodeMessage const& message)
+{
+ message.visit(
+ [&](SetWaveShaperParameters const& parameters) {
+ m_curve = parameters.curve;
+ m_oversample = parameters.oversample;
+ },
+ [](auto const&) { });
+}
+
+// https://webaudio.github.io/web-audio-api/#dom-waveshapernode-curve
+float WaveShaperRenderNode::shape(float sample) const
+{
+ // 1. Let x be the input sample, y be the corresponding output of the node, c_k be the k'th element of the curve,
+ // and N be the length of the curve.
+ auto const& curve = m_curve->values;
+ auto curve_length = curve.size();
+
+ // 2. Let v = (N-1)/2 (x + 1), k = floor(v), f = v - k
+ double v = (curve_length - 1) / 2.0 * (static_cast<double>(sample) + 1);
+
+ // 3. Then y = c_0 if v < 0, c_{N-1} if v >= N - 1, and (1-f) c_k + f c_{k+1} otherwise.
+ // NB: A NaN sample maps to c_0 as well.
+ if (!(v >= 0))
+ return curve.first();
+ if (v >= curve_length - 1)
+ return curve.last();
+ auto k = static_cast<size_t>(v);
+ double f = v - k;
+ return static_cast<float>((1 - f) * curve[k] + f * curve[k + 1]);
+}
+
+// NB: The up-sampling and down-sampling filters are not specified. These use a windowed sinc filter whose cutoff is
+// half its band.
+Array<float, WaveShaperRenderNode::half_band_filter_length> const& WaveShaperRenderNode::half_band_filter_coefficients()
+{
+ static auto const coefficients = [] {
+ static constexpr size_t length = half_band_filter_length;
+ Array<double, length> taps {};
+ double sum = 0;
+ for (size_t index = 0; index < length; ++index) {
+ double offset = static_cast<double>(index) - (length - 1) / 2.0;
+ double sinc = offset == 0 ? 1 : AK::sin(AK::Pi<double> * offset / 2) / (AK::Pi<double> * offset / 2);
+ double phase = 2 * AK::Pi<double> * index / (length - 1);
+ double blackman_window = 0.42 - 0.5 * AK::cos(phase) + 0.08 * AK::cos(2 * phase);
+ taps[index] = sinc * blackman_window;
+ sum += taps[index];
+ }
+ Array<float, length> result {};
+ for (size_t index = 0; index < length; ++index)
+ result[index] = static_cast<float>(taps[index] / sum);
+ return result;
+ }();
+ return coefficients;
+}
+
+float WaveShaperRenderNode::HalfBandFilter::process(float sample)
+{
+ auto const& coefficients = half_band_filter_coefficients();
+ // NB: Every sample is stored twice, so that the last samples are contiguous wherever the ring buffer starts.
+ history[position] = sample;
+ history[position + half_band_filter_length] = sample;
+ auto const* newest_sample = &history[position + half_band_filter_length];
+ float result = 0;
+ for (size_t index = 0; index < half_band_filter_length; ++index)
+ result += coefficients[index] * *(newest_sample - index);
+ position = position + 1 == half_band_filter_length ? 0 : position + 1;
+ return result;
+}
+
+void WaveShaperRenderNode::up_sample(HalfBandFilter& filter, ReadonlySpan<float> input, Span<float> output)
+{
+ VERIFY(output.size() == input.size() * 2);
+ // NB: The zeros between the samples halve the gain of the filter, which the factor of 2 restores.
+ for (size_t index = 0; index < input.size(); ++index) {
+ output[2 * index] = 2 * filter.process(input[index]);
+ output[2 * index + 1] = 2 * filter.process(0);
+ }
+}
+
+void WaveShaperRenderNode::down_sample(HalfBandFilter& filter, ReadonlySpan<float> input, Span<float> output)
+{
+ VERIFY(input.size() == output.size() * 2);
+ for (size_t index = 0; index < output.size(); ++index) {
+ output[index] = filter.process(input[2 * index]);
+ (void)filter.process(input[2 * index + 1]);
+ }
+}
+
+void WaveShaperRenderNode::process(RenderGraph& graph, RenderContext const& context)
+{
+ auto const& input = pull_input(graph, context, 0);
+
+ // The number of channels of the output always equals the number of channels of the input.
+ auto& shaper_output = output(0);
+ shaper_output.set_channel_count(input.channel_count());
+ if (m_channel_states.size() != input.channel_count())
+ m_channel_states.resize(input.channel_count());
+
+ for (size_t channel_index = 0; channel_index < input.channel_count(); ++channel_index) {
+ auto input_samples = input.channel(channel_index).slice(0, context.quantum_size);
+ auto output_samples = shaper_output.channel(channel_index).slice(0, context.quantum_size);
+
+ // Initially the curve attribute is null, which means that the WaveShaperNode will pass its input to its output
+ // without modification.
+ if (!m_curve) {
+ input_samples.copy_to(output_samples);
+ continue;
+ }
+
+ auto& state = m_channel_states[channel_index];
+ switch (m_oversample) {
+ case Bindings::OverSampleType::None:
+ // The default value is "none", meaning the curve will be applied directly to the input samples.
+ for (size_t frame = 0; frame < context.quantum_size; ++frame)
+ output_samples[frame] = shape(input_samples[frame]);
+ break;
+ case Bindings::OverSampleType::_2x: {
+ // 1. Up-sample the input samples to 2x or 4x the sample-rate of the AudioContext. Thus for each render
+ // quantum, generate twice (for 2x) or four times (for 4x) samples.
+ auto samples = m_two_times_samples.span();
+ up_sample(state.up_sampling_filters[0], input_samples, samples);
+
+ // 2. Apply the shaping curve.
+ for (auto& sample : samples)
+ sample = shape(sample);
+
+ // 3. Down-sample the result back to the sample-rate of the AudioContext. Thus taking the previously
+ // processed samples processed samples, generating a single render quantum worth of samples as the
+ // final result.
+ down_sample(state.down_sampling_filters[0], samples, output_samples);
+ break;
+ }
+ case Bindings::OverSampleType::_4x: {
+ // 1. Up-sample the input samples to 2x or 4x the sample-rate of the AudioContext. Thus for each render
+ // quantum, generate twice (for 2x) or four times (for 4x) samples.
+ auto two_times_samples = m_two_times_samples.span();
+ auto four_times_samples = m_four_times_samples.span();
+ up_sample(state.up_sampling_filters[0], input_samples, two_times_samples);
+ up_sample(state.up_sampling_filters[1], two_times_samples, four_times_samples);
+
+ // 2. Apply the shaping curve.
+ for (auto& sample : four_times_samples)
+ sample = shape(sample);
+
+ // 3. Down-sample the result back to the sample-rate of the AudioContext. Thus taking the previously
+ // processed samples processed samples, generating a single render quantum worth of samples as the
+ // final result.
+ down_sample(state.down_sampling_filters[1], four_times_samples, two_times_samples);
+ down_sample(state.down_sampling_filters[0], two_times_samples, output_samples);
+ break;
+ }
+ }
+ }
+}
+
namespace {
// Gfx::DoubleVector3::normalize() divides by the length unconditionally, which would produce NaN components for a zero
diff --git a/Libraries/LibWeb/WebAudio/Rendering/RenderNodes.h b/Libraries/LibWeb/WebAudio/Rendering/RenderNodes.h
index 1aba6071060..9146d1294a4 100644
--- a/Libraries/LibWeb/WebAudio/Rendering/RenderNodes.h
+++ b/Libraries/LibWeb/WebAudio/Rendering/RenderNodes.h
@@ -235,6 +235,64 @@ private:
Vector<FilterState> m_filter_states;
};
+// https://webaudio.github.io/web-audio-api/#IIRFilterNode
+class IIRFilterRenderNode final : public RenderNode {
+public:
+ IIRFilterRenderNode(NodeID, size_t quantum_size, Vector<double> feedforward, Vector<double> feedback);
+
+ virtual void process(RenderGraph&, RenderContext const&) override;
+
+private:
+ // The previous inputs and outputs of the filter for one channel, as ring buffers indexed by the frame number.
+ static constexpr size_t history_size = 32;
+ struct FilterState {
+ Array<double, history_size> inputs {};
+ Array<double, history_size> outputs {};
+ };
+
+ Vector<double> m_feedforward;
+ Vector<double> m_feedback;
+ Vector<FilterState> m_filter_states;
+ size_t m_position { 0 };
+};
+
+// https://webaudio.github.io/web-audio-api/#WaveShaperNode
+class WaveShaperRenderNode final : public RenderNode {
+public:
+ WaveShaperRenderNode(NodeID, size_t quantum_size);
+
+ virtual void process(RenderGraph&, RenderContext const&) override;
+ virtual void handle_message(NodeMessage const&) override;
+
+private:
+ // A lowpass FIR filter that passes the lower half of its band, which is the band of the signal at half its sample
+ // rate. Up-sampling by 2 filters the input with zeros between its samples, and down-sampling by 2 keeps every other
+ // sample of the filtered signal.
+ static constexpr size_t half_band_filter_length = 31;
+ struct HalfBandFilter {
+ float process(float sample);
+
+ Array<float, half_band_filter_length * 2> history {};
+ size_t position { 0 };
+ };
+
+ struct ChannelState {
+ Array<HalfBandFilter, 2> up_sampling_filters;
+ Array<HalfBandFilter, 2> down_sampling_filters;
+ };
+
+ static Array<float, half_band_filter_length> const& half_band_filter_coefficients();
+ float shape(float sample) const;
+ void up_sample(HalfBandFilter&, ReadonlySpan<float> input, Span<float> output);
+ void down_sample(HalfBandFilter&, ReadonlySpan<float> input, Span<float> output);
+
+ RefPtr<WaveShaperCurve> m_curve;
+ Bindings::OverSampleType m_oversample { Bindings::OverSampleType::None };
+ Vector<ChannelState> m_channel_states;
+ Vector<float> m_two_times_samples;
+ Vector<float> m_four_times_samples;
+};
+
// Convolves the input with an impulse response. The head of the impulse response is convolved directly, and the rest
// through uniformly partitioned overlap-save convolution: every quantum, the window spanning the previous and the
// current quantum is transformed and pushed into a frequency delay line, whose spectra are then multiplied with the
diff --git a/Libraries/LibWeb/WebAudio/WaveShaperNode.cpp b/Libraries/LibWeb/WebAudio/WaveShaperNode.cpp
new file mode 100644
index 00000000000..3dc0b9c4af8
--- /dev/null
+++ b/Libraries/LibWeb/WebAudio/WaveShaperNode.cpp
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2026-present, the Ladybird developers.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibGC/Heap.h>
+#include <LibJS/Runtime/TypedArray.h>
+#include <LibWeb/HTML/Scripting/Environments.h>
+#include <LibWeb/WebAudio/AudioArray.h>
+#include <LibWeb/WebAudio/BaseAudioContext.h>
+#include <LibWeb/WebAudio/Rendering/RenderNodes.h>
+#include <LibWeb/WebAudio/WaveShaperNode.h>
+#include <LibWeb/WebIDL/DOMException.h>
+
+namespace Web::WebAudio {
+
+GC_DEFINE_ALLOCATOR(WaveShaperNode);
+
+WaveShaperNode::WaveShaperNode(GC::Ref<BaseAudioContext> context)
+ : AudioNode(context)
+{
+}
+
+WaveShaperNode::~WaveShaperNode() = default;
+
+WebIDL::ExceptionOr<GC::Ref<WaveShaperNode>> WaveShaperNode::create(GC::Ref<BaseAudioContext> context, WaveShaperOptions const& options)
+{
+ // When the constructor is called with a BaseAudioContext c and an option object option, the user agent MUST
+ // initialize the AudioNode this, with context and options as arguments.
+ auto node = GC::Heap::the().allocate<WaveShaperNode>(context);
+
+ // https://webaudio.github.io/web-audio-api/#WaveShaperNode
+ AudioNodeDefaultOptions default_options;
+ default_options.channel_count_mode = ChannelCountMode::Max;
+ default_options.channel_interpretation = ChannelInterpretation::Speakers;
+ default_options.channel_count = 2;
+ // FIXME: Set tail-time to yes when the oversample attribute is "2x" or "4x".
+
+ TRY(node->initialize_audio_node_options(options, default_options));
+
+ node->queue_render_node_creation(make<Rendering::WaveShaperRenderNode>(node->node_id(), BaseAudioContext::render_quantum_size()));
+
+ node->m_oversample = options.oversample;
+
+ // Also, let [[curve set]] be an internal slot of this WaveShaperNode. Initialize this slot to false. If options is
+ // given and specifies a curve, set [[curve set]] to true.
+ // NB: Setting the curve attribute to the curve of options sets [[curve set]] to true.
+ if (options.curve.has_value()) {
+ auto& realm = HTML::relevant_realm(node->relevant_global_object());
+ auto const& curve = *options.curve;
+ auto array = TRY(JS::Float32Array::create(realm, curve.size()));
+ overwrite_float32_array(*array, curve);
+ TRY(node->set_curve(array));
+ } else {
+ node->send_parameters_to_render_node();
+ }
+
+ return node;
+}
+
+// https://webaudio.github.io/web-audio-api/#dom-waveshapernode-waveshapernode
+WebIDL::ExceptionOr<GC::Ref<WaveShaperNode>> WaveShaperNode::create_for_constructor(GC::Ref<BaseAudioContext> context, WaveShaperOptions const& options)
+{
+ return create(context, options);
+}
+
+// https://webaudio.github.io/web-audio-api/#dom-waveshapernode-curve
+WebIDL::ExceptionOr<void> WaveShaperNode::set_curve(GC::Ptr<JS::Float32Array> new_curve)
+{
+ // A InvalidStateError MUST be thrown if this attribute is set with a Float32Array that has a length less than 2.
+ if (new_curve && float32_array_length(*new_curve) < 2)
+ return WebIDL::InvalidStateError::create("The curve must have at least two values"_utf16);
+
+ // To set the curve attribute, execute these steps:
+ // 1. Let new curve be a Float32Array to be assigned to curve or null. .
+ // 2. If new curve is not null and [[curve set]] is true, throw an InvalidStateError and abort these steps.
+ if (new_curve && m_curve_set)
+ return WebIDL::InvalidStateError::create("The curve has already been set"_utf16);
+
+ // 3. If new curve is not null, set [[curve set]] to true.
+ if (new_curve)
+ m_curve_set = true;
+
+ // 4. Assign new curve to the curve attribute.
+ m_curve = new_curve;
+
+ // When this attribute is set, an internal copy of the curve is created by the WaveShaperNode. Subsequent
+ // modifications of the contents of the array used to set the attribute therefore have no effect.
+ m_curve_copy = new_curve ? adopt_ref(*new Rendering::WaveShaperCurve(copy_float32_array(*new_curve))) : nullptr;
+ send_parameters_to_render_node();
+ return {};
+}
+
+// https://webaudio.github.io/web-audio-api/#dom-waveshapernode-oversample
+void WaveShaperNode::set_oversample(OverSampleType oversample)
+{
+ m_oversample = oversample;
+ send_parameters_to_render_node();
+}
+
+void WaveShaperNode::send_parameters_to_render_node()
+{
+ context()->queue_control_message(NodeMessage { SetWaveShaperParameters {
+ .node_id = node_id(),
+ .curve = m_curve_copy,
+ .oversample = m_oversample,
+ } });
+}
+
+void WaveShaperNode::visit_edges(Cell::Visitor& visitor)
+{
+ Base::visit_edges(visitor);
+ visitor.visit(m_curve);
+}
+
+}
diff --git a/Libraries/LibWeb/WebAudio/WaveShaperNode.h b/Libraries/LibWeb/WebAudio/WaveShaperNode.h
new file mode 100644
index 00000000000..054065673b4
--- /dev/null
+++ b/Libraries/LibWeb/WebAudio/WaveShaperNode.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2026-present, the Ladybird developers.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <LibWeb/Bindings/WaveShaperNode.h>
+#include <LibWeb/WebAudio/AudioNode.h>
+#include <LibWeb/WebAudio/Rendering/AudioData.h>
+
+namespace Web::WebAudio {
+
+using OverSampleType = Bindings::OverSampleType;
+using WaveShaperOptions = Bindings::WaveShaperOptions;
+
+// https://webaudio.github.io/web-audio-api/#WaveShaperNode
+class WaveShaperNode final : public AudioNode {
+ WEB_WRAPPABLE(WaveShaperNode, AudioNode);
+ GC_DECLARE_ALLOCATOR(WaveShaperNode);
+
+public:
+ virtual ~WaveShaperNode() override;
+
+ static WebIDL::ExceptionOr<GC::Ref<WaveShaperNode>> create(GC::Ref<BaseAudioContext>, WaveShaperOptions const& = {});
+ static WebIDL::ExceptionOr<GC::Ref<WaveShaperNode>> create_for_constructor(GC::Ref<BaseAudioContext>, WaveShaperOptions const& = {});
+
+ WebIDL::UnsignedLong number_of_inputs() override { return 1; }
+ WebIDL::UnsignedLong number_of_outputs() override { return 1; }
+
+ GC::Ptr<JS::Float32Array> curve() const { return m_curve; }
+ WebIDL::ExceptionOr<void> set_curve(GC::Ptr<JS::Float32Array>);
+
+ OverSampleType oversample() const { return m_oversample; }
+ void set_oversample(OverSampleType);
+
+private:
+ explicit WaveShaperNode(GC::Ref<BaseAudioContext>);
+
+ virtual void visit_edges(Cell::Visitor&) override;
+
+ void send_parameters_to_render_node();
+
+ // https://webaudio.github.io/web-audio-api/#dom-waveshapernode-curve
+ GC::Ptr<JS::Float32Array> m_curve;
+ // When this attribute is set, an internal copy of the curve is created by the WaveShaperNode.
+ RefPtr<Rendering::WaveShaperCurve> m_curve_copy;
+
+ // https://webaudio.github.io/web-audio-api/#dom-waveshapernode-curve-set-slot
+ bool m_curve_set { false };
+
+ // https://webaudio.github.io/web-audio-api/#dom-waveshapernode-oversample
+ OverSampleType m_oversample { OverSampleType::None };
+};
+
+}
diff --git a/Libraries/LibWeb/WebAudio/WaveShaperNode.idl b/Libraries/LibWeb/WebAudio/WaveShaperNode.idl
new file mode 100644
index 00000000000..2a83236d7f4
--- /dev/null
+++ b/Libraries/LibWeb/WebAudio/WaveShaperNode.idl
@@ -0,0 +1,20 @@
+// https://webaudio.github.io/web-audio-api/#enumdef-oversampletype
+enum OverSampleType {
+ "none",
+ "2x",
+ "4x"
+};
+
+// https://webaudio.github.io/web-audio-api/#WaveShaperOptions
+dictionary WaveShaperOptions : AudioNodeOptions {
+ sequence<float> curve;
+ OverSampleType oversample = "none";
+};
+
+// https://webaudio.github.io/web-audio-api/#WaveShaperNode
+[Exposed=Window]
+interface WaveShaperNode : AudioNode {
+ constructor (BaseAudioContext context, optional WaveShaperOptions options = {});
+ attribute Float32Array? curve;
+ attribute OverSampleType oversample;
+};
diff --git a/Libraries/LibWeb/idl_files.cmake b/Libraries/LibWeb/idl_files.cmake
index ee8a032e389..e7242019ce6 100644
--- a/Libraries/LibWeb/idl_files.cmake
+++ b/Libraries/LibWeb/idl_files.cmake
@@ -648,6 +648,7 @@ libweb_js_bindings(WebAudio/ConvolverNode)
libweb_js_bindings(WebAudio/DelayNode)
libweb_js_bindings(WebAudio/DynamicsCompressorNode)
libweb_js_bindings(WebAudio/GainNode)
+libweb_js_bindings(WebAudio/IIRFilterNode)
libweb_js_bindings(WebAudio/MediaElementAudioSourceNode)
libweb_js_bindings(WebAudio/MediaStreamAudioDestinationNode)
libweb_js_bindings(WebAudio/MediaStreamAudioSourceNode)
@@ -658,6 +659,7 @@ libweb_js_bindings(WebAudio/PannerNode)
libweb_js_bindings(WebAudio/PeriodicWave)
libweb_js_bindings(WebAudio/ScriptProcessorNode)
libweb_js_bindings(WebAudio/StereoPannerNode)
+libweb_js_bindings(WebAudio/WaveShaperNode)
libweb_js_bindings(WebGL/Extensions/ANGLEInstancedArrays)
libweb_js_bindings(WebGL/Extensions/EXTBlendMinMax)
libweb_js_bindings(WebGL/Extensions/EXTColorBufferFloat)
diff --git a/Tests/LibWeb/Text/expected/all-window-properties.txt b/Tests/LibWeb/Text/expected/all-window-properties.txt
index 2e992c8b053..75f8201e163 100644
--- a/Tests/LibWeb/Text/expected/all-window-properties.txt
+++ b/Tests/LibWeb/Text/expected/all-window-properties.txt
@@ -288,6 +288,7 @@ IDBRecord
IDBRequest
IDBTransaction
IDBVersionChangeEvent
+IIRFilterNode
IdleDeadline
Image
ImageBitmap
@@ -584,6 +585,7 @@ VideoTrackList
ViewTimeline
ViewTransition
VisualViewport
+WaveShaperNode
WeakMap
WeakRef
WeakSet
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/idlharness.https.window.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/idlharness.https.window.txt
index 25ef1e1d4c1..72c4bdb81cd 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/idlharness.https.window.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/idlharness.https.window.txt
@@ -2,8 +2,8 @@ Harness status: OK
Found 1163 tests
-1000 Pass
-163 Fail
+1077 Pass
+86 Fail
Fail idl_test setup
Pass idl_test validation
Pass Partial interface Element: member names are unique
@@ -40,13 +40,13 @@ Pass BaseAudioContext interface: operation createConvolver()
Pass BaseAudioContext interface: operation createDelay(optional double)
Pass BaseAudioContext interface: operation createDynamicsCompressor()
Pass BaseAudioContext interface: operation createGain()
-Fail BaseAudioContext interface: operation createIIRFilter(sequence<double>, sequence<double>)
+Pass BaseAudioContext interface: operation createIIRFilter(sequence<double>, sequence<double>)
Pass BaseAudioContext interface: operation createOscillator()
Pass BaseAudioContext interface: operation createPanner()
Pass BaseAudioContext interface: operation createPeriodicWave(sequence<float>, sequence<float>, optional PeriodicWaveConstraints)
Pass BaseAudioContext interface: operation createScriptProcessor(optional unsigned long, optional unsigned long, optional unsigned long)
Pass BaseAudioContext interface: operation createStereoPanner()
-Fail BaseAudioContext interface: operation createWaveShaper()
+Pass BaseAudioContext interface: operation createWaveShaper()
Pass BaseAudioContext interface: operation decodeAudioData(ArrayBuffer, optional DecodeSuccessCallback?, optional DecodeErrorCallback?)
Pass AudioContext interface: existence and properties of interface object
Pass AudioContext interface object length
@@ -113,8 +113,8 @@ Pass BaseAudioContext interface: context must inherit property "createDelay(opti
Pass BaseAudioContext interface: calling createDelay(optional double) on context with too few arguments must throw TypeError
Pass BaseAudioContext interface: context must inherit property "createDynamicsCompressor()" with the proper type
Pass BaseAudioContext interface: context must inherit property "createGain()" with the proper type
-Fail BaseAudioContext interface: context must inherit property "createIIRFilter(sequence<double>, sequence<double>)" with the proper type
-Fail BaseAudioContext interface: calling createIIRFilter(sequence<double>, sequence<double>) on context with too few arguments must throw TypeError
+Pass BaseAudioContext interface: context must inherit property "createIIRFilter(sequence<double>, sequence<double>)" with the proper type
+Pass BaseAudioContext interface: calling createIIRFilter(sequence<double>, sequence<double>) on context with too few arguments must throw TypeError
Pass BaseAudioContext interface: context must inherit property "createOscillator()" with the proper type
Pass BaseAudioContext interface: context must inherit property "createPanner()" with the proper type
Pass BaseAudioContext interface: context must inherit property "createPeriodicWave(sequence<float>, sequence<float>, optional PeriodicWaveConstraints)" with the proper type
@@ -122,7 +122,7 @@ Pass BaseAudioContext interface: calling createPeriodicWave(sequence<float>, seq
Pass BaseAudioContext interface: context must inherit property "createScriptProcessor(optional unsigned long, optional unsigned long, optional unsigned long)" with the proper type
Pass BaseAudioContext interface: calling createScriptProcessor(optional unsigned long, optional unsigned long, optional unsigned long) on context with too few arguments must throw TypeError
Pass BaseAudioContext interface: context must inherit property "createStereoPanner()" with the proper type
-Fail BaseAudioContext interface: context must inherit property "createWaveShaper()" with the proper type
+Pass BaseAudioContext interface: context must inherit property "createWaveShaper()" with the proper type
Pass BaseAudioContext interface: context must inherit property "decodeAudioData(ArrayBuffer, optional DecodeSuccessCallback?, optional DecodeErrorCallback?)" with the proper type
Pass BaseAudioContext interface: calling decodeAudioData(ArrayBuffer, optional DecodeSuccessCallback?, optional DecodeErrorCallback?) on context with too few arguments must throw TypeError
Fail AudioSinkInfo interface: existence and properties of interface object
@@ -174,8 +174,8 @@ Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must
Pass BaseAudioContext interface: calling createDelay(optional double) on new OfflineAudioContext(1, 1, sample_rate) with too few arguments must throw TypeError
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createDynamicsCompressor()" with the proper type
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createGain()" with the proper type
-Fail BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createIIRFilter(sequence<double>, sequence<double>)" with the proper type
-Fail BaseAudioContext interface: calling createIIRFilter(sequence<double>, sequence<double>) on new OfflineAudioContext(1, 1, sample_rate) with too few arguments must throw TypeError
+Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createIIRFilter(sequence<double>, sequence<double>)" with the proper type
+Pass BaseAudioContext interface: calling createIIRFilter(sequence<double>, sequence<double>) on new OfflineAudioContext(1, 1, sample_rate) with too few arguments must throw TypeError
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createOscillator()" with the proper type
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createPanner()" with the proper type
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createPeriodicWave(sequence<float>, sequence<float>, optional PeriodicWaveConstraints)" with the proper type
@@ -183,7 +183,7 @@ Pass BaseAudioContext interface: calling createPeriodicWave(sequence<float>, seq
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createScriptProcessor(optional unsigned long, optional unsigned long, optional unsigned long)" with the proper type
Pass BaseAudioContext interface: calling createScriptProcessor(optional unsigned long, optional unsigned long, optional unsigned long) on new OfflineAudioContext(1, 1, sample_rate) with too few arguments must throw TypeError
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createStereoPanner()" with the proper type
-Fail BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createWaveShaper()" with the proper type
+Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createWaveShaper()" with the proper type
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "decodeAudioData(ArrayBuffer, optional DecodeSuccessCallback?, optional DecodeErrorCallback?)" with the proper type
Pass BaseAudioContext interface: calling decodeAudioData(ArrayBuffer, optional DecodeSuccessCallback?, optional DecodeErrorCallback?) on new OfflineAudioContext(1, 1, sample_rate) with too few arguments must throw TypeError
Pass OfflineAudioCompletionEvent interface: existence and properties of interface object
@@ -771,40 +771,40 @@ Pass AudioNode interface: new GainNode(context) must inherit property "numberOfO
Pass AudioNode interface: new GainNode(context) must inherit property "channelCount" with the proper type
Pass AudioNode interface: new GainNode(context) must inherit property "channelCountMode" with the proper type
Pass AudioNode interface: new GainNode(context) must inherit property "channelInterpretation" with the proper type
-Fail IIRFilterNode interface: existence and properties of interface object
-Fail IIRFilterNode interface object length
-Fail IIRFilterNode interface object name
-Fail IIRFilterNode interface: existence and properties of interface prototype object
-Fail IIRFilterNode interface: existence and properties of interface prototype object's "constructor" property
-Fail IIRFilterNode interface: existence and properties of interface prototype object's @@unscopables property
-Fail IIRFilterNode interface: operation getFrequencyResponse(Float32Array, Float32Array, Float32Array)
-Fail IIRFilterNode must be primary interface of new IIRFilterNode(context, {feedforward: [1], feedback: [1]})
-Fail Stringification of new IIRFilterNode(context, {feedforward: [1], feedback: [1]})
-Fail IIRFilterNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "getFrequencyResponse(Float32Array, Float32Array, Float32Array)" with the proper type
-Fail IIRFilterNode interface: calling getFrequencyResponse(Float32Array, Float32Array, Float32Array) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "connect(AudioNode, optional unsigned long, optional unsigned long)" with the proper type
-Fail AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "connect(AudioParam, optional unsigned long)" with the proper type
-Fail AudioNode interface: calling connect(AudioParam, optional unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect()" with the proper type
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(unsigned long)" with the proper type
-Fail AudioNode interface: calling disconnect(unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioNode)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioNode) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioNode, unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioParam)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioParam) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioParam, unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "context" with the proper type
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "numberOfInputs" with the proper type
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "numberOfOutputs" with the proper type
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "channelCount" with the proper type
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "channelCountMode" with the proper type
-Fail AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "channelInterpretation" with the proper type
+Pass IIRFilterNode interface: existence and properties of interface object
+Pass IIRFilterNode interface object length
+Pass IIRFilterNode interface object name
+Pass IIRFilterNode interface: existence and properties of interface prototype object
+Pass IIRFilterNode interface: existence and properties of interface prototype object's "constructor" property
+Pass IIRFilterNode interface: existence and properties of interface prototype object's @@unscopables property
+Pass IIRFilterNode interface: operation getFrequencyResponse(Float32Array, Float32Array, Float32Array)
+Pass IIRFilterNode must be primary interface of new IIRFilterNode(context, {feedforward: [1], feedback: [1]})
+Pass Stringification of new IIRFilterNode(context, {feedforward: [1], feedback: [1]})
+Pass IIRFilterNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "getFrequencyResponse(Float32Array, Float32Array, Float32Array)" with the proper type
+Pass IIRFilterNode interface: calling getFrequencyResponse(Float32Array, Float32Array, Float32Array) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "connect(AudioNode, optional unsigned long, optional unsigned long)" with the proper type
+Pass AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "connect(AudioParam, optional unsigned long)" with the proper type
+Pass AudioNode interface: calling connect(AudioParam, optional unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect()" with the proper type
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(unsigned long)" with the proper type
+Pass AudioNode interface: calling disconnect(unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioNode)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioNode) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioNode, unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioParam)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioParam) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioParam, unsigned long) on new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) with too few arguments must throw TypeError
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "context" with the proper type
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "numberOfInputs" with the proper type
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "numberOfOutputs" with the proper type
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "channelCount" with the proper type
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "channelCountMode" with the proper type
+Pass AudioNode interface: new IIRFilterNode(context, {feedforward: [1], feedback: [1]}) must inherit property "channelInterpretation" with the proper type
Pass MediaElementAudioSourceNode interface: existence and properties of interface object
Pass MediaElementAudioSourceNode interface object length
Pass MediaElementAudioSourceNode interface object name
@@ -1070,41 +1070,41 @@ Pass AudioNode interface: new StereoPannerNode(context) must inherit property "n
Pass AudioNode interface: new StereoPannerNode(context) must inherit property "channelCount" with the proper type
Pass AudioNode interface: new StereoPannerNode(context) must inherit property "channelCountMode" with the proper type
Pass AudioNode interface: new StereoPannerNode(context) must inherit property "channelInterpretation" with the proper type
-Fail WaveShaperNode interface: existence and properties of interface object
-Fail WaveShaperNode interface object length
-Fail WaveShaperNode interface object name
-Fail WaveShaperNode interface: existence and properties of interface prototype object
-Fail WaveShaperNode interface: existence and properties of interface prototype object's "constructor" property
-Fail WaveShaperNode interface: existence and properties of interface prototype object's @@unscopables property
-Fail WaveShaperNode interface: attribute curve
-Fail WaveShaperNode interface: attribute oversample
-Fail WaveShaperNode must be primary interface of new WaveShaperNode(context)
-Fail Stringification of new WaveShaperNode(context)
-Fail WaveShaperNode interface: new WaveShaperNode(context) must inherit property "curve" with the proper type
-Fail WaveShaperNode interface: new WaveShaperNode(context) must inherit property "oversample" with the proper type
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioNode, optional unsigned long, optional unsigned long)" with the proper type
-Fail AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioParam, optional unsigned long)" with the proper type
-Fail AudioNode interface: calling connect(AudioParam, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect()" with the proper type
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(unsigned long)" with the proper type
-Fail AudioNode interface: calling disconnect(unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioNode) on new WaveShaperNode(context) with too few arguments must throw TypeError
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioNode, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioParam) on new WaveShaperNode(context) with too few arguments must throw TypeError
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type
-Fail AudioNode interface: calling disconnect(AudioParam, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "context" with the proper type
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfInputs" with the proper type
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfOutputs" with the proper type
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "channelCount" with the proper type
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "channelCountMode" with the proper type
-Fail AudioNode interface: new WaveShaperNode(context) must inherit property "channelInterpretation" with the proper type
+Pass WaveShaperNode interface: existence and properties of interface object
+Pass WaveShaperNode interface object length
+Pass WaveShaperNode interface object name
+Pass WaveShaperNode interface: existence and properties of interface prototype object
+Pass WaveShaperNode interface: existence and properties of interface prototype object's "constructor" property
+Pass WaveShaperNode interface: existence and properties of interface prototype object's @@unscopables property
+Pass WaveShaperNode interface: attribute curve
+Pass WaveShaperNode interface: attribute oversample
+Pass WaveShaperNode must be primary interface of new WaveShaperNode(context)
+Pass Stringification of new WaveShaperNode(context)
+Pass WaveShaperNode interface: new WaveShaperNode(context) must inherit property "curve" with the proper type
+Pass WaveShaperNode interface: new WaveShaperNode(context) must inherit property "oversample" with the proper type
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioNode, optional unsigned long, optional unsigned long)" with the proper type
+Pass AudioNode interface: calling connect(AudioNode, optional unsigned long, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "connect(AudioParam, optional unsigned long)" with the proper type
+Pass AudioNode interface: calling connect(AudioParam, optional unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect()" with the proper type
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(unsigned long)" with the proper type
+Pass AudioNode interface: calling disconnect(unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioNode) on new WaveShaperNode(context) with too few arguments must throw TypeError
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioNode, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioNode, unsigned long, unsigned long)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioNode, unsigned long, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioParam) on new WaveShaperNode(context) with too few arguments must throw TypeError
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "disconnect(AudioParam, unsigned long)" with the proper type
+Pass AudioNode interface: calling disconnect(AudioParam, unsigned long) on new WaveShaperNode(context) with too few arguments must throw TypeError
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "context" with the proper type
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfInputs" with the proper type
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "numberOfOutputs" with the proper type
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "channelCount" with the proper type
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "channelCountMode" with the proper type
+Pass AudioNode interface: new WaveShaperNode(context) must inherit property "channelInterpretation" with the proper type
Pass AudioWorklet interface: existence and properties of interface object
Pass AudioWorklet interface object length
Pass AudioWorklet interface object name
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-audioparam-interface/audioparam-nominal-range.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-audioparam-interface/audioparam-nominal-range.txt
index 99ed417668b..9bca71c7e0e 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-audioparam-interface/audioparam-nominal-range.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-audioparam-interface/audioparam-nominal-range.txt
@@ -1,9 +1,8 @@
Harness status: OK
-Found 323 tests
+Found 327 tests
-321 Pass
-2 Fail
+327 Pass
Pass # AUDIT TASK RUNNER STARTED.
Pass Executing "initialize"
Pass Executing "Offline createGain"
@@ -16,8 +15,8 @@ Pass Executing "Offline createOscillator"
Pass Executing "Offline createPanner"
Pass Executing "Offline createConstantSource"
Pass Executing "Offline createBuffer"
-Fail Executing "Offline createIIRFilter"
-Fail Executing "Offline createWaveShaper"
+Pass Executing "Offline createIIRFilter"
+Pass Executing "Offline createWaveShaper"
Pass Executing "Offline createConvolver"
Pass Executing "Offline createAnalyser"
Pass Executing "Offline createScriptProcessor"
@@ -238,7 +237,11 @@ Pass > [Offline createBuffer]
Pass AudioBuffer has no AudioParams as expected
Pass < [Offline createBuffer] All assertions passed. (total 1 assertions)
Pass > [Offline createIIRFilter]
+Pass IIRFilterNode has no AudioParams as expected
+Pass < [Offline createIIRFilter] All assertions passed. (total 1 assertions)
Pass > [Offline createWaveShaper]
+Pass WaveShaperNode has no AudioParams as expected
+Pass < [Offline createWaveShaper] All assertions passed. (total 1 assertions)
Pass > [Offline createConvolver]
Pass ConvolverNode has no AudioParams as expected
Pass < [Offline createConvolver] All assertions passed. (total 1 assertions)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.txt
index 7142c7685f0..f880d83ecee 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/ctor-iirfilter.txt
@@ -2,11 +2,10 @@ Harness status: OK
Found 6 tests
-2 Pass
-4 Fail
+6 Pass
Pass Initialize OfflineAudioContext
Pass Invalid IIRFilterNode constructor should throw
-Fail Default IIRFilterNode constructor with feedforward/feedback
-Fail Test AudioNodeOptions on IIRFilterNode
-Fail IIRFilterNode constructor should throw with missing required options
-Fail Functional test of IIRFilterNode constructor vs. legacy method
\ No newline at end of file
+Pass Default IIRFilterNode constructor with feedforward/feedback
+Pass Test AudioNodeOptions on IIRFilterNode
+Pass IIRFilterNode constructor should throw with missing required options
+Pass Functional test of IIRFilterNode constructor vs. legacy method
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.txt
index 0cc88e6fe29..34eb29db2e8 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-basic.txt
@@ -1,38 +1,48 @@
Harness status: OK
-Found 32 tests
+Found 43 tests
-18 Pass
-14 Fail
+43 Pass
Pass # AUDIT TASK RUNNER STARTED.
Pass Executing "initialize"
Pass Executing "existence"
-Fail Executing "parameters"
+Pass Executing "parameters"
Pass Executing "exceptions-createIIRFilter"
-Fail Executing "exceptions-getFrequencyData"
+Pass Executing "exceptions-getFrequencyData"
Pass Audit report
Pass > [initialize]
Pass Initialize context for testing did not throw an exception.
Pass < [initialize] All assertions passed. (total 1 assertions)
Pass > [existence]
-Fail X context.createIIRFilter does not exist. Got undefined.
-Fail < [existence] 1 out of 1 assertions were failed.
+Pass context.createIIRFilter does exist.
+Pass < [existence] All assertions passed. (total 1 assertions)
Pass > [parameters]
+Pass numberOfInputs is equal to 1.
+Pass numberOfOutputs is equal to 1.
+Pass channelCountMode is equal to max.
+Pass channelInterpretation is equal to speakers.
+Pass < [parameters] All assertions passed. (total 4 assertions)
Pass > [exceptions-createIIRFilter]
-Pass createIIRFilter() threw TypeError: "undefined is not a function (evaluated from 'context.createIIRFilter')".
-Pass createIIRFilter(new Float32Array(1)) threw TypeError: "undefined is not a function (evaluated from 'context.createIIRFilter')".
-Pass createIIRFilter(null, null) threw TypeError: "undefined is not a function (evaluated from 'context.createIIRFilter')".
-Fail X createIIRFilter([], []) threw "TypeError" instead of NotSupportedError.
-Fail X createIIRFilter([1], []) threw "TypeError" instead of NotSupportedError.
-Fail X createIIRFilter([], [1]) threw "TypeError" instead of NotSupportedError.
-Fail X createIIRFilter(new Float32Array(20), new Float32Array(20)) incorrectly threw TypeError: "undefined is not a function (evaluated from 'context.createIIRFilter')".
-Fail X createIIRFilter(new Float32Array(21), [1]) threw "TypeError" instead of NotSupportedError.
-Fail X createIIRFilter([1], new Float32Array(21)) threw "TypeError" instead of NotSupportedError.
-Fail X createIIRFilter([1], new Float32Array(2)) threw "TypeError" instead of InvalidStateError.
-Fail X createIIRFilter(new Float32Array(10), [1]) threw "TypeError" instead of InvalidStateError.
-Pass createIIRFilter([1], [1, NaN, Infinity]) threw TypeError: "undefined is not a function (evaluated from 'context.createIIRFilter')".
-Pass createIIRFilter([1, NaN, Infinity], [1]) threw TypeError: "undefined is not a function (evaluated from 'context.createIIRFilter')".
-Pass createIIRFilter([1, 'abc', []], [1]) threw TypeError: "undefined is not a function (evaluated from 'context.createIIRFilter')".
-Fail < [exceptions-createIIRFilter] 8 out of 14 assertions were failed.
+Pass createIIRFilter() threw TypeError: "createIIRFilter() needs 2 arguments".
+Pass createIIRFilter(new Float32Array(1)) threw TypeError: "createIIRFilter() needs 2 arguments".
+Pass createIIRFilter(null, null) threw TypeError: "null is not an object".
+Pass createIIRFilter([], []) threw NotSupportedError: "The number of feedforward coefficients must be between 1 and 20".
+Pass createIIRFilter([1], []) threw NotSupportedError: "The number of feedback coefficients must be between 1 and 20".
+Pass createIIRFilter([], [1]) threw NotSupportedError: "The number of feedforward coefficients must be between 1 and 20".
+Pass createIIRFilter(new Float32Array(20), new Float32Array(20)) did not throw an exception.
+Pass createIIRFilter(new Float32Array(21), [1]) threw NotSupportedError: "The number of feedforward coefficients must be between 1 and 20".
+Pass createIIRFilter([1], new Float32Array(21)) threw NotSupportedError: "The number of feedback coefficients must be between 1 and 20".
+Pass createIIRFilter([1], new Float32Array(2)) threw InvalidStateError: "The first feedback coefficient must not be zero".
+Pass createIIRFilter(new Float32Array(10), [1]) threw InvalidStateError: "At least one feedforward coefficient must not be zero".
+Pass createIIRFilter([1], [1, NaN, Infinity]) threw TypeError: "Expected feedback to be a finite floating-point number".
+Pass createIIRFilter([1, NaN, Infinity], [1]) threw TypeError: "Expected feedforward to be a finite floating-point number".
+Pass createIIRFilter([1, 'abc', []], [1]) threw TypeError: "Expected feedforward to be a finite floating-point number".
+Pass < [exceptions-createIIRFilter] All assertions passed. (total 14 assertions)
Pass > [exceptions-getFrequencyData]
-Fail # AUDIT TASK RUNNER FINISHED: 2 out of 5 tasks were failed.
\ No newline at end of file
+Pass getFrequencyResponse(null, new Float32Array(1), new Float32Array(1)) threw TypeError: "Not an object of type Float32Array".
+Pass getFrequencyResponse(new Float32Array(1), null, new Float32Array(1)) threw TypeError: "Not an object of type Float32Array".
+Pass getFrequencyResponse(new Float32Array(1), new Float32Array(1), null) threw TypeError: "Not an object of type Float32Array".
+Pass getFrequencyResponse(new Float32Array(10), new Float32Array(1), new Float32Array(20)) threw InvalidAccessError: "Arrays must have the same length".
+Pass getFrequencyResponse(new Float32Array(10), new Float32Array(20), new Float32Array(1)) threw InvalidAccessError: "Arrays must have the same length".
+Pass < [exceptions-getFrequencyData] All assertions passed. (total 5 assertions)
+Pass # AUDIT TASK RUNNER FINISHED: 5 tasks ran successfully.
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-getFrequencyResponse.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-getFrequencyResponse.txt
index afea9ca7f63..38a6afc0646 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-getFrequencyResponse.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-getFrequencyResponse.txt
@@ -2,7 +2,7 @@ Harness status: OK
Found 3 tests
-3 Fail
-Fail 1-pole IIR getFrequencyResponse() matches analytic response
-Fail IIR filter equivalent to biquad has matching frequency response
-Fail Out-of-range frequency values yield NaN responses
\ No newline at end of file
+3 Pass
+Pass 1-pole IIR getFrequencyResponse() matches analytic response
+Pass IIR filter equivalent to biquad has matching frequency response
+Pass Out-of-range frequency values yield NaN responses
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-normalization-precision.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-normalization-precision.txt
index b3ee3cd8d8b..e002ec07656 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-normalization-precision.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter-normalization-precision.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail IIR coefficient normalization stays precise when feedback[0] is not exactly representable as a float
\ No newline at end of file
+1 Pass
+Pass IIR coefficient normalization stays precise when feedback[0] is not exactly representable as a float
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter.txt
index b47e6e4d2d1..c58df93637d 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/iirfilter.txt
@@ -1,37 +1,73 @@
Harness status: OK
-Found 31 tests
+Found 68 tests
-15 Pass
-16 Fail
+68 Pass
Pass # AUDIT TASK RUNNER STARTED.
-Fail Executing "coefficient-normalization"
-Fail Executing "one-zero"
-Fail Executing "one-pole"
-Fail Executing "0: lowpass"
-Fail Executing "1: highpass"
-Fail Executing "2: bandpass"
-Fail Executing "3: notch"
-Fail Executing "4: allpass"
-Fail Executing "5: lowshelf"
-Fail Executing "6: highshelf"
-Fail Executing "7: peaking"
-Fail Executing "multi-channel"
-Fail Executing "4th-order-iir"
+Pass Executing "coefficient-normalization"
+Pass Executing "one-zero"
+Pass Executing "one-pole"
+Pass Executing "0: lowpass"
+Pass Executing "1: highpass"
+Pass Executing "2: bandpass"
+Pass Executing "3: notch"
+Pass Executing "4: allpass"
+Pass Executing "5: lowshelf"
+Pass Executing "6: highshelf"
+Pass Executing "7: peaking"
+Pass Executing "multi-channel"
+Pass Executing "4th-order-iir"
Pass Audit report
Pass > [coefficient-normalization]
-Fail X createIIRFilter with normalized coefficients incorrectly threw TypeError: "undefined is not a function (evaluated from 'context.createIIRFilter')".
-Fail X createIIRFilter with unnormalized coefficients incorrectly threw TypeError: "undefined is not a function (evaluated from 'context.createIIRFilter')".
+Pass createIIRFilter with normalized coefficients did not throw an exception.
+Pass createIIRFilter with unnormalized coefficients did not throw an exception.
+Pass Output of IIR filter with unnormalized coefficients equals [1,-0.8999999761581421,0.8100000023841858,-0.7289999723434448,0.6560999751091003,-0.5904899835586548,0.5314409732818604,-0.4782969057559967,0.4304672181606293,-0.3874204754829407,0.34867843985557556,-0.3138105869293213,0.2824295461177826,-0.25418657064437866,0.22876793146133423,-0.20589113235473633...] with an element-wise tolerance of {"absoluteThreshold":2.1958e-38,"relativeThreshold":0}.
+Pass < [coefficient-normalization] All assertions passed. (total 3 assertions)
Pass > [one-zero]
+Pass IIR 1-zero output equals [0.5,0.5,0,0,0,0,0,0,0,0,0,0,0,0,0,0...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0}.
+Pass < [one-zero] All assertions passed. (total 1 assertions)
Pass > [one-pole]
+Pass IIR 1-pole output equals [1,-0.9,0.81,-0.7290000000000001,0.6561000000000001,-0.5904900000000002,0.5314410000000002,-0.47829690000000014,0.43046721000000016,-0.38742048900000015,0.34867844010000015,-0.31381059609000017,0.28242953648100017,-0.25418658283290013,0.22876792454961012,-0.2058911320946491...] with an element-wise tolerance of {"absoluteThreshold":2.7657e-8,"relativeThreshold":0}.
+Pass < [one-pole] All assertions passed. (total 1 assertions)
Pass > [0: lowpass]
+Pass IIRFilter for Biquad lowpass equals [0.002067622495815158,0.010262038558721542,0.026408344507217407,0.0501461960375309,0.08106273412704468,0.11869751662015915,0.16254764795303345,0.2120732069015503,0.26670268177986145,0.32583874464035034,0.3888637125492096,0.4551454186439514,0.5240428447723389,0.5949114561080933,0.6671090722084045,0.7400005459785461...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0.000049834}.
+Pass SNR for IIRFIlter for Biquad lowpass is greater than or equal to 91.221.
+Pass < [0: lowpass] All assertions passed. (total 2 assertions)
Pass > [1: highpass]
+Pass IIRFilter for Biquad highpass equals [0.9836710095405579,0.9474786520004272,0.9044824242591858,0.8552321195602417,0.8003132939338684,0.7403419613838196,0.6759582161903381,0.6078203320503235,0.5365989208221436,0.462971031665802,0.3876142203807831,0.3112010061740875,0.23439353704452515,0.15783827006816864,0.08216116577386856,0.007963056676089764...] with an element-wise tolerance of {"absoluteThreshold":0.0000029,"relativeThreshold":0.00003}.
+Pass SNR for IIRFIlter for Biquad highpass is greater than or equal to 105.459.
+Pass < [1: highpass] All assertions passed. (total 2 assertions)
Pass > [2: bandpass]
+Pass IIRFilter for Biquad bandpass equals [0.004554244689643383,0.01358321588486433,0.022416500374674797,0.030982105061411858,0.039210930466651917,0.047037314623594284,0.05439956113696098,0.061240408569574356,0.06750746816396713,0.07315362989902496,0.07813738286495209,0.0824231505393982,0.08598148077726364,0.08878929913043976,0.09082996845245361,0.09209345281124115...] with an element-wise tolerance of {"absoluteThreshold":2e-7,"relativeThreshold":0.00087}.
+Pass SNR for IIRFIlter for Biquad bandpass is greater than or equal to 104.06.
+Pass < [2: bandpass] All assertions passed. (total 2 assertions)
Pass > [3: notch]
+Pass IIRFilter for Biquad notch equals [0.995445728302002,0.986416757106781,0.9775835275650024,0.9690179228782654,0.9607890844345093,0.9529626965522766,0.9456004500389099,0.9387595653533936,0.9324925541877747,0.9268463850021362,0.9218626022338867,0.9175768494606018,0.9140185117721558,0.9112107157707214,0.9091700315475464,0.9079065322875977...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0.0000422}.
+Pass SNR for IIRFIlter for Biquad notch is greater than or equal to 91.312.
+Pass < [3: notch] All assertions passed. (total 2 assertions)
Pass > [4: allpass]
+Pass IIRFilter for Biquad allpass equals [0.9908915162086487,0.9728335738182068,0.9551669955253601,0.938035786151886,0.9215781688690186,0.9059253931045532,0.8912009000778198,0.8775191903114319,0.8649850487709045,0.8536927700042725,0.8437252044677734,0.8351536989212036,0.8280370235443115,0.8224214315414429,0.8183400630950928,0.8158131241798401...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0.0000431}.
+Pass SNR for IIRFIlter for Biquad allpass is greater than or equal to 91.319.
+Pass < [4: allpass] All assertions passed. (total 2 assertions)
Pass > [5: lowshelf]
+Pass IIRFilter for Biquad lowshelf equals [1.038480281829834,1.1165722608566284,1.1966440677642822,1.278151512145996,1.360594630241394,1.443515419960022,1.526496171951294,1.609157681465149,1.6911571025848389,1.7721866369247437,1.851970911026001,1.930266261100769,2.0068578720092773,2.0815584659576416,2.1542069911956787,2.224666118621826...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0.0000298}.
+Pass SNR for IIRFIlter for Biquad lowshelf is greater than or equal to 90.609.
+Pass < [5: lowshelf] All assertions passed. (total 2 assertions)
Pass > [6: highshelf]
+Pass IIRFilter for Biquad highshelf equals [3.0451014041900635,2.816114664077759,2.5985424518585205,2.3935577869415283,2.2019753456115723,2.024296998977661,1.8607537746429443,1.7113466262817383,1.5758823156356812,1.4540070295333862,1.345236897468567,1.2489848136901855,1.1645853519439697,1.091315746307373,1.0284156799316406,0.975102961063385...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0.0000124}.
+Pass SNR for IIRFIlter for Biquad highshelf is greater than or equal to 103.159.
+Pass < [6: highshelf] All assertions passed. (total 2 assertions)
Pass > [7: peaking]
+Pass IIRFilter for Biquad peaking equals [1.0055487155914307,1.016571283340454,1.0273985862731934,1.0379410982131958,1.048111915588379,1.0578279495239258,1.0670101642608643,1.0755844116210938,1.0834821462631226,1.0906407833099365,1.0970040559768677,1.1025229692459106,1.107155442237854,1.1108675003051758,1.1136326789855957,1.1154327392578125...] with an element-wise tolerance of {"absoluteThreshold":0,"relativeThreshold":0.0000505}.
+Pass SNR for IIRFIlter for Biquad peaking is greater than or equal to 91.504.
+Pass < [7: peaking] All assertions passed. (total 2 assertions)
Pass > [multi-channel]
+Pass Max difference between IIR and Biquad on channel 0 is less than or equal to 0.000037671.
+Pass Max difference between IIR and Biquad on channel 1 is less than or equal to 0.000030071.
+Pass Max difference between IIR and Biquad on channel 2 is less than or equal to 0.000026241.
+Pass < [multi-channel] All assertions passed. (total 3 assertions)
Pass > [4th-order-iir]
-Fail # AUDIT TASK RUNNER FINISHED: 1 out of 13 tasks were failed.
\ No newline at end of file
+Pass 4-th order IIRFilter (biquad ref) equals [0.000004181719305051956,0.000032965795980999246,0.00012939768203068525,0.0003477365826256573,0.0007387272780761123,0.0013446897501125932,0.0021993762347847223,0.0033279559575021267,0.0047471169382333755,0.006465281825512648,0.008482922799885273,0.010792970657348633,0.013381303288042545,0.01622731238603592,0.019304519519209862,0.022581251338124275...] with an element-wise tolerance of {"absoluteThreshold":1.59e-7,"relativeThreshold":0.0000211}.
+Pass SNR of 4-th order IIRFilter (biquad ref) is greater than or equal to 108.947.
+Pass < [4th-order-iir] All assertions passed. (total 2 assertions)
+Pass # AUDIT TASK RUNNER FINISHED: 13 tasks ran successfully.
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/test-iirfilternode.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/test-iirfilternode.txt
index 3634dca2433..da0d0bbf1fe 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/test-iirfilternode.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-iirfilternode-interface/test-iirfilternode.txt
@@ -2,13 +2,12 @@ Harness status: OK
Found 8 tests
-1 Pass
-7 Fail
+8 Pass
Pass IIRFilterNode coefficients are checked properly
-Fail feedforward coefficients can not be empty
-Fail feedback coefficients can not be empty
-Fail more than 20 feedforward coefficients can not be used
-Fail more than 20 feedback coefficients can not be used
-Fail at least one feedforward coefficient must be non-zero
-Fail the first feedback coefficient must be non-zero
-Fail IIRFilterNode getFrequencyResponse handles invalid frequencies properly
\ No newline at end of file
+Pass feedforward coefficients can not be empty
+Pass feedback coefficients can not be empty
+Pass more than 20 feedforward coefficients can not be used
+Pass more than 20 feedback coefficients can not be used
+Pass at least one feedforward coefficient must be non-zero
+Pass the first feedback coefficient must be non-zero
+Pass IIRFilterNode getFrequencyResponse handles invalid frequencies properly
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.txt
index ff2774247b4..85ec140c3bd 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/ctor-waveshaper.txt
@@ -1,28 +1,59 @@
Harness status: OK
-Found 22 tests
+Found 54 tests
-15 Pass
-7 Fail
+54 Pass
Pass # AUDIT TASK RUNNER STARTED.
Pass Executing "initialize"
Pass Executing "incorrect construction"
-Fail Executing "valid default construction"
-Fail Executing "test AudioNodeOptions"
-Fail Executing "valid non-default"
+Pass Executing "valid default construction"
+Pass Executing "test AudioNodeOptions"
+Pass Executing "valid non-default"
Pass Audit report
Pass > [initialize]
Pass context = new OfflineAudioContext(...) did not throw an exception.
Pass < [initialize] All assertions passed. (total 1 assertions)
Pass > [incorrect construction]
-Pass new WaveShaperNode() threw TypeError: "undefined is not a constructor (evaluated from 'window[name]')".
-Pass new WaveShaperNode(1) threw TypeError: "undefined is not a constructor (evaluated from 'window[name]')".
-Pass new WaveShaperNode(context, 42) threw TypeError: "undefined is not a constructor (evaluated from 'window[name]')".
+Pass new WaveShaperNode() threw TypeError: "WaveShaperNode() needs one argument".
+Pass new WaveShaperNode(1) threw TypeError: "Not an object of type BaseAudioContext".
+Pass new WaveShaperNode(context, 42) threw TypeError: "Not an object of type WaveShaperOptions".
Pass < [incorrect construction] All assertions passed. (total 3 assertions)
Pass > [valid default construction]
-Fail X node0 = new WaveShaperNode(context) incorrectly threw TypeError: "undefined is not a constructor (evaluated from 'window[name]')".
+Pass node0 = new WaveShaperNode(context) did not throw an exception.
+Pass node0 instanceof WaveShaperNode is equal to true.
+Pass node0.numberOfInputs is equal to 1.
+Pass node0.numberOfOutputs is equal to 1.
+Pass node0.channelCount is equal to 2.
+Pass node0.channelCountMode is equal to max.
+Pass node0.channelInterpretation is equal to speakers.
+Pass node0.curve is equal to null.
+Pass node0.oversample is equal to none.
+Pass < [valid default construction] All assertions passed. (total 9 assertions)
Pass > [test AudioNodeOptions]
-Fail X new WaveShaperNode(c, {channelCount: 17}) incorrectly threw TypeError: "undefined is not a constructor (evaluated from 'window[nodeName]')".
+Pass new WaveShaperNode(c, {channelCount: 17}) did not throw an exception.
+Pass node.channelCount is equal to 17.
+Pass new WaveShaperNode(c, {channelCount: 0}) threw NotSupportedError: "Invalid channel count".
+Pass new WaveShaperNode(c, {channelCount: 99}) threw NotSupportedError: "Invalid channel count".
+Pass new WaveShaperNode(c, {channelCountMode: "max"} did not throw an exception.
+Pass node.channelCountMode is equal to max.
+Pass new WaveShaperNode(c, {channelCountMode: "max"}) did not throw an exception.
+Pass node.channelCountMode after valid setter is equal to max.
+Pass new WaveShaperNode(c, {channelCountMode: "clamped-max"}) did not throw an exception.
+Pass node.channelCountMode after valid setter is equal to clamped-max.
+Pass new WaveShaperNode(c, {channelCountMode: "explicit"}) did not throw an exception.
+Pass node.channelCountMode after valid setter is equal to explicit.
+Pass new WaveShaperNode(c, {channelCountMode: "foobar"} threw TypeError: "Invalid value 'foobar' for enumeration type 'ChannelCountMode'".
+Pass node.channelCountMode after invalid setter is equal to explicit.
+Pass new WaveShaperNode(c, {channelInterpretation: "speakers"}) did not throw an exception.
+Pass node.channelInterpretation is equal to speakers.
+Pass new WaveShaperNode(c, {channelInterpretation: "discrete"}) did not throw an exception.
+Pass node.channelInterpretation is equal to discrete.
+Pass new WaveShaperNode(c, {channelInterpretation: "foobar"}) threw TypeError: "Invalid value 'foobar' for enumeration type 'ChannelInterpretation'".
+Pass node.channelInterpretation after invalid setter is equal to discrete.
+Pass < [test AudioNodeOptions] All assertions passed. (total 20 assertions)
Pass > [valid non-default]
-Fail X node1 = new WaveShaperNode(, {"curve":{"0":1,"1":2,"2":3},"oversample":"4x"}) incorrectly threw ReferenceError: "'WaveShaperNode' is not defined".
-Fail # AUDIT TASK RUNNER FINISHED: 3 out of 5 tasks were failed.
\ No newline at end of file
+Pass node1 = new WaveShaperNode(, {"curve":{"0":1,"1":2,"2":3},"oversample":"4x"}) did not throw an exception.
+Pass node1.curve is identical to the array [1,2,3].
+Pass node1.oversample is equal to 4x.
+Pass < [valid non-default] All assertions passed. (total 3 assertions)
+Pass # AUDIT TASK RUNNER FINISHED: 5 tasks ran successfully.
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/curve-tests.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/curve-tests.txt
index e2d76f932d7..a83202d4b95 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/curve-tests.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/curve-tests.txt
@@ -2,11 +2,11 @@ Harness status: OK
Found 7 tests
-7 Fail
-Fail WaveShaperNode - Testing that -1, 0 and +1 map correctly to curve (with 1:1 correlation)
-Fail WaveShaperNode - Testing interpolation (where inputs don't correlate directly to curve elements)
-Fail WaveShaperNode - Testing out-of-range inputs (should be mapped to the first/last elements of the curve)
-Fail WaveShaperNode - Testing a 2-element curve (does not have a middle element)
-Fail WaveShaperNode - Testing a 4-element curve (does not have a middle element)
-Fail WaveShaperNode - Testing a huge curve
-Fail WaveShaperNode - Testing null curve (should return input values)
\ No newline at end of file
+7 Pass
+Pass WaveShaperNode - Testing that -1, 0 and +1 map correctly to curve (with 1:1 correlation)
+Pass WaveShaperNode - Testing interpolation (where inputs don't correlate directly to curve elements)
+Pass WaveShaperNode - Testing out-of-range inputs (should be mapped to the first/last elements of the curve)
+Pass WaveShaperNode - Testing a 2-element curve (does not have a middle element)
+Pass WaveShaperNode - Testing a 4-element curve (does not have a middle element)
+Pass WaveShaperNode - Testing a huge curve
+Pass WaveShaperNode - Testing null curve (should return input values)
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs.txt
index b0a4979afed..801e6b3ac14 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs.txt
@@ -2,7 +2,7 @@ Harness status: OK
Found 3 tests
-3 Fail
-Fail test-0: curve output is non-zero for silent inputs
-Fail test-1: 2x curve output is non-zero for silent inputs
-Fail test-2: curve output is non-zero for no inputs
\ No newline at end of file
+3 Pass
+Pass test-0: curve output is non-zero for silent inputs
+Pass test-1: 2x curve output is non-zero for silent inputs
+Pass test-2: curve output is non-zero for no inputs
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.txt
index 53ca4d8ea1f..d8b36e59346 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-copy-curve.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail test copying: Modifying curve should not modify WaveShaper
\ No newline at end of file
+1 Pass
+Pass test copying: Modifying curve should not modify WaveShaper
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-limits.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-limits.txt
index a9e67e99589..229f7bde519 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-limits.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-limits.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail WaveShaperNode maps input values outside [-1,1] according to curve and clamps output correctly
\ No newline at end of file
+1 Pass
+Pass WaveShaperNode maps input values outside [-1,1] according to curve and clamps output correctly
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple.txt
index 75ee1c51175..3c5b08102c7 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple.txt
@@ -1,11 +1,23 @@
Harness status: OK
-Found 5 tests
+Found 18 tests
-4 Pass
-1 Fail
+18 Pass
Pass # AUDIT TASK RUNNER STARTED.
-Fail Executing "simple"
+Pass Executing "simple"
Pass Audit report
Pass > [simple]
+Pass Initial WaveShaper.curve is equal to null.
+Pass Initial WaveShaper.oversample is equal to none.
+Pass Setting oversample to "2x" did not throw an exception.
+Pass Waveshaper.oversample = "2x" is equal to 2x.
+Pass Setting oversample to "4x" did not throw an exception.
+Pass Waveshaper.oversample = "4x" is equal to 4x.
+Pass Setting oversample to "invalid" did not throw an exception.
+Pass Waveshaper.oversample = "invalid" is equal to 4x.
+Pass Setting curve to [-1,0.25,0.75] did not throw an exception.
+Pass WaveShaper.curve is identical to the array [-1,0.25,0.75].
+Pass Setting curve back to null did not throw an exception.
+Pass Waveshaper.curve = null is equal to null.
+Pass < [simple] All assertions passed. (total 12 assertions)
Pass # AUDIT TASK RUNNER FINISHED: 1 tasks ran successfully.
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper.txt b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper.txt
index d7c1dd5063f..c8022ecccf4 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper.txt
@@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
-1 Fail
-Fail WaveShaperNode applies non-linear distortion correctly
\ No newline at end of file
+1 Pass
+Pass WaveShaperNode applies non-linear distortion correctly
\ No newline at end of file