Skip to content

Commit

Permalink
Add createBiquadFilter()
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Sep 20, 2018
1 parent 1be4168 commit bb61487
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 26 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/baseaudiocontext.rs
Expand Up @@ -348,7 +348,7 @@ impl BaseAudioContextMethods for BaseAudioContext {

/// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createbiquadfilter
fn CreateBiquadFilter(&self) -> Fallible<DomRoot<BiquadFilterNode>> {
BiquadFilterNode::new(&self.global().as_window(), &self, &BiquadFilter::empty())
BiquadFilterNode::new(&self.global().as_window(), &self, &BiquadFilterOptions::empty())
}

/// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelmerger
Expand Down
6 changes: 3 additions & 3 deletions components/script/dom/biquadfilternode.rs
Expand Up @@ -128,17 +128,17 @@ impl BiquadFilterNodeMethods for BiquadFilterNode {

// https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-q
fn Q(&self) -> DomRoot<AudioParam> {
DomRoot::from_ref(&self.gain)
DomRoot::from_ref(&self.q)
}

// https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-detune
fn Detune(&self) -> DomRoot<AudioParam> {
DomRoot::from_ref(&self.gain)
DomRoot::from_ref(&self.detune)
}

// https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-frequency
fn Frequency(&self) -> DomRoot<AudioParam> {
DomRoot::from_ref(&self.gain)
DomRoot::from_ref(&self.frequency)
}

// https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-type
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/webidls/BaseAudioContext.webidl
Expand Up @@ -38,7 +38,7 @@ interface BaseAudioContext : EventTarget {
[Throws] AnalyserNode createAnalyser();
[Throws] GainNode createGain();
// DelayNode createDelay(optional double maxDelayTime = 1);
// BiquadFilterNode createBiquadFilter();
[Throws] BiquadFilterNode createBiquadFilter();
// IIRFilterNode createIIRFilter(sequence<double> feedforward,
// sequence<double> feedback);
// WaveShaperNode createWaveShaper();
Expand Down
9 changes: 0 additions & 9 deletions tests/wpt/metadata/webaudio/idlharness.https.window.js.ini
Expand Up @@ -8,9 +8,6 @@
[BaseAudioContext interface: attribute audioWorklet]
expected: FAIL

[BaseAudioContext interface: operation createBiquadFilter()]
expected: FAIL

[BaseAudioContext interface: operation createChannelSplitter(unsigned long)]
expected: FAIL

Expand Down Expand Up @@ -89,9 +86,6 @@
[BaseAudioContext interface: context must inherit property "audioWorklet" with the proper type]
expected: FAIL

[BaseAudioContext interface: context must inherit property "createBiquadFilter()" with the proper type]
expected: FAIL

[BaseAudioContext interface: context must inherit property "createChannelSplitter(unsigned long)" with the proper type]
expected: FAIL

Expand Down Expand Up @@ -155,9 +149,6 @@
[BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "audioWorklet" with the proper type]
expected: FAIL

[BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createBiquadFilter()" with the proper type]
expected: FAIL

[BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createChannelSplitter(unsigned long)" with the proper type]
expected: FAIL

Expand Down
@@ -1,2 +1,10 @@
[biquad-allpass.html]
expected: ERROR
[X Max error in Allpass filter response is not less than or equal to 3.9337e-8. Got 2.805464744567871.]
expected: FAIL

[< [test\] 1 out of 3 assertions were failed.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

@@ -1,2 +1,2 @@
[biquad-automation.html]
expected: ERROR
expected: CRASH
@@ -1,2 +1,10 @@
[biquad-bandpass.html]
expected: ERROR
[< [test\] 1 out of 3 assertions were failed.]
expected: FAIL

[X Max error in Bandpass filter response is not less than or equal to 2.2501e-8. Got 1.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

@@ -1,8 +1,19 @@
[biquad-basic.html]
expected: ERROR
[< [existence\] 1 out of 1 assertions were failed.]
expected: FAIL

[X context.createBiquadFilter does not exist. Got undefined.]
expected: FAIL

[X getFrequencyResponse(new Float32Array(10), new Float32Array(1), new Float32Array(20)) threw "TypeError" instead of InvalidAccessError.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 5 tasks were failed.]
expected: FAIL

[X getFrequencyResponse(new Float32Array(10), new Float32Array(20), new Float32Array(1)) threw "TypeError" instead of InvalidAccessError.]
expected: FAIL

[< [exceptions-getFrequencyData\] 2 out of 5 assertions were failed.]
expected: FAIL

@@ -1,2 +1,10 @@
[biquad-highpass.html]
expected: ERROR
[< [test\] 1 out of 3 assertions were failed.]
expected: FAIL

[X Max error in Highpass filter response is not less than or equal to 1.5487e-8. Got 1.9329860210418701.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

@@ -1,2 +1,10 @@
[biquad-highshelf.html]
expected: ERROR
[< [test\] 1 out of 3 assertions were failed.]
expected: FAIL

[X Max error in Highshelf filter response is not less than or equal to 6.2577e-8. Got 2.3278465244357536.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

@@ -1,2 +1,10 @@
[biquad-lowpass.html]
expected: ERROR
[< [test\] 1 out of 3 assertions were failed.]
expected: FAIL

[X Max error in Lowpass filter response is not less than or equal to 9.7869e-8. Got 1.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

@@ -1,2 +1,10 @@
[biquad-lowshelf.html]
expected: ERROR
[< [test\] 1 out of 3 assertions were failed.]
expected: FAIL

[X Max error in Lowshelf filter response is not less than or equal to 3.8349e-8. Got 3.162277660168379.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

@@ -1,2 +1,10 @@
[biquad-notch.html]
expected: ERROR
[< [test\] 1 out of 3 assertions were failed.]
expected: FAIL

[X Max error in Notch filter response is not less than or equal to 1.9669e-8. Got 2.9027323722839355.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

@@ -1,2 +1,10 @@
[biquad-peaking.html]
expected: ERROR
[< [test\] 1 out of 3 assertions were failed.]
expected: FAIL

[X Max error in Peaking filter response is not less than or equal to 5.8234e-8. Got 3.162277660168379.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 1 tasks were failed.]
expected: FAIL

This file was deleted.

0 comments on commit bb61487

Please sign in to comment.