New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AudioListener/AudioPanner DOM interfaces #21502
Conversation
Heads up! This PR modifies the following files:
|
35b8104
to
9a52aac
Compare
Tested, the following example works: <script type="text/javascript">
let ctx = new AudioContext();
let osc = ctx.createOscillator();
let panner = new PannerNode(ctx, {"coneOuterAngle": 0, "positionX": 100, "positionY": 0, "positionZ": 100, "refDistance": 100, "rolloffFactor": 0.01});
osc.connect(panner);
panner.connect(ctx.destination);
osc.start();
panner.positionX.linearRampToValueAtTime(-100, 0.2);
panner.positionX.linearRampToValueAtTime(100, 0.2);
panner.positionX.linearRampToValueAtTime(-100, 0.4);
panner.positionX.linearRampToValueAtTime(-100, 0.4);
panner.positionX.linearRampToValueAtTime(100, 0.6);
panner.positionX.linearRampToValueAtTime(-100, 0.6);
panner.positionX.linearRampToValueAtTime(100, 0.8);
panner.positionX.linearRampToValueAtTime(100, 0.8);
panner.positionX.linearRampToValueAtTime(-100, 1.0);
panner.positionX.linearRampToValueAtTime(100, 1.0);
panner.positionX.linearRampToValueAtTime(-100, 1.2);
panner.positionX.linearRampToValueAtTime(-100, 1.2);
panner.positionX.linearRampToValueAtTime(100, 1.4);
panner.positionX.linearRampToValueAtTime(-100, 1.4);
panner.positionX.linearRampToValueAtTime(100, 1.6);
panner.positionX.linearRampToValueAtTime(100, 1.6);
</script> (should I check this in to tests/html?) |
@bors-servo try=wpt |
Add AudioListener/AudioPanner DOM interfaces Seems to work. I'll need some changes to the servo-media side to support the panner node getters as well as the older `setPosition()`/etc APIs. I'll get to those later. r? @ferjm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21502) <!-- Reviewable:end -->
💔 Test failed - linux-rel-css |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
We need to add the channelCount and channelCountMode constraints for PannerNode
.
Likewise, even though we do not support HRTF yet, we should also add the autiomationRate
constraints for PannerNode
and AudioListener
AudioParams.
Thanks!
window, | ||
context, | ||
node, | ||
ParamType::Position(ParamDir::Y), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be ParamDir::Z
window, | ||
context, | ||
node, | ||
ParamType::Forward(ParamDir::Y), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ParamDir::Z
window, | ||
context, | ||
node, | ||
ParamType::Up(ParamDir::Y), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ParamDir::Z
@@ -297,6 +304,15 @@ impl BaseAudioContextMethods for BaseAudioContext { | |||
}) | |||
} | |||
|
|||
/// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-destination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change link to https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-listener
, please
We don't have autiomationrate constraints, the automationrate is simply ignored (this code already exists in the media crate) |
@bors-servo try=wpt |
Add AudioListener/AudioPanner DOM interfaces Seems to work. I'll need some changes to the servo-media side to support the panner node getters as well as the older `setPosition()`/etc APIs. I'll get to those later. r? @ferjm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21502) <!-- Reviewable:end -->
This should cause a bunch of new WPT failures since previously some tests didn't fully run at all, but that's okay. At some point we need to switch gears to WPT and whittle those down, most of them aren't much work. |
💔 Test failed - linux-rel-css |
@bors-servo r=ferjm |
📌 Commit 25332f0 has been approved by |
Add AudioListener/AudioPanner DOM interfaces Seems to work. I'll need some changes to the servo-media side to support the panner node getters as well as the older `setPosition()`/etc APIs. I'll get to those later. r? @ferjm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21502) <!-- Reviewable:end -->
💔 Test failed - linux-dev |
@bors-servo r=ferjm
|
📌 Commit 04e60e6 has been approved by |
Add AudioListener/AudioPanner DOM interfaces Seems to work. I'll need some changes to the servo-media side to support the panner node getters as well as the older `setPosition()`/etc APIs. I'll get to those later. r? @ferjm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21502) <!-- Reviewable:end -->
💔 Test failed - mac-rel-wpt1 |
@bors-servo retry
seems intermittent, let's find out |
⚡ Previous build results for android, android-x86, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev are reusable. Rebuilding only mac-rel-wpt1... |
☀️ Test successful - android, android-x86, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Seems to work.
I'll need some changes to the servo-media side to support the panner
node getters as well as the older
setPosition()
/etc APIs. I'll get tothose later.
r? @ferjm
This change is