-
Notifications
You must be signed in to change notification settings - Fork 203
Add Web Audio API #1300
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 Web Audio API #1300
Conversation
| safari_ios: "14.5" | ||
| compat_features: | ||
| # baseline: high | ||
| # baseline_low_date: 2015-07-29 |
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.
@ddbeck claiming that these bits of the API have been Baseline since 2015 while the whole feature only since 2021 doesn't seem right. You can't use any of this without a prefix unless the unprefixed AudioContext constructor is supported.
Should getStatus perhaps clamp support to the support of the overall feature? The downside is that if we do that for a feature where the Baseline status (false/low/high) isn't the same for the feature and its earliest parts, that would end up being confusing on MDN, as compat tables could claim support but the Baseline badge says not Baseline, as well as getting the low/high connection to dates wrong, although that's not as noticeable.
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.
Should
getStatusperhaps clamp support to the support of the overall feature? The downside is that if we do that for a feature where the Baseline status (false/low/high) isn't the same for the feature and its earliest parts, that would end up being confusing on MDN, as compat tables could claim support but the Baseline badge says not Baseline, as well as getting the low/high connection to dates wrong, although that's not as noticeable.
So I'm guessing there's four scenarios, for any given key:
- It's newer than the overall feature (by baseline low date). You do want to show the newer status.
- It's the same as the overall feature (by baseline low date, even if the specific versions differ). No conflict.
- It's older than the overall feature. It works in isolation, so you want to show the older status.
- It's older than the overall feature. It depends on another part of the feature, so you want to show the newer status.
It's scenario 4 that's the danger here, right? If that's much more common than scenario 3, we should just clamp the status. If scenario 3 is much more common, then that's probably not a good idea.
Brainstorming here, there are a few ways to deal with that situation. Most are on the consumer side:
- If it's in scenario 3 or 4, change the appearance on MDN to say, "This is part of another feature, with a different status." (I'd like to see the "this is part of…" thing in the widget, but that's an even more general matter.)
- If it's in scenario 3 or 4, make the page author decide which status to show. (I prefer this! These are the people who ought to know best! But I don't think the MDN folks are hyped about this idea, though I could be wrong.)
The only part I think we can do on the authoring side would be to do the work of declaring some keys as being tightly coupled, to opt-in to clamping just those keys. That'd still leave apparent conflicts on MDN, but they'd be good scenario 4 conflicts, where Baseline tells a more correct story than the compat table.
So you might have something like this:
coupled_compat_features:
- [api.AnalyserNode, api.AudioContext]That would say, "for these keys specifically, clamp to the worst availability of them, otherwise, proceed normally."
If this is rare, I'd hate to have to proactively research every feature for this. But it'd be an escape hatch for "broken" features, as they get reported.
(I suppose one other option would exist, which is maybe more correct but harder: do this annotation in BCD.)
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.
@ddbeck those four scenarios look correct, although I would really consider any differences in status, not just differences in Baseline low date. I'd like a way to override data that don't make sense together, even if it's only at the level of browser versions.
And yes, scenario 4 is the issue here. It should be common for prefixed features, especially APIs with multiple interfaces but where the prefix is in a single place, the entrypoint.
For scenario 3, I'm struggling to think of when we'd decide to author a feature like this. I can imagine it in theory, that some marginally useful part of a feature shipped first, followed by the real thing that was motivating it to begin with. So perhaps for Set this would happen if we decide that size is an essential part of the feature, leaving the initial parts in Firefox under scenario 3.
I wonder if a variation of use_ranges_before_baseline_low_date could be revived for this, perhaps use_ranges_before_initial_support that would use ranges for everything before the browser version in the overall feature.
An important part of this is to cut down on the amount of research we need to do, to move faster.
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.
I wonder if a variation of
use_ranges_before_baseline_low_datecould be revived for this, perhapsuse_ranges_before_initial_supportthat would use ranges for everything before the browser version in the overall feature.
I like this idea. We should try it, once we're surfacing ranges.
Heck, we could try clamping anything pre-compute_from as ≤ with respect to the Baseline low date and versions, by default. Then, for those cases where things might be useable anyway (Set without size), we opt into unclamping?
Filing this as #1335.
| # edge: "79" | ||
| # safari: "14.1" | ||
| # safari_ios: "14.5" | ||
| - api.AudioListener.forwardX |
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 matches https://developer.mozilla.org/en-US/docs/Web/API/AudioListener#browser_compatibility and the notes make me trust the data.
| # edge: "79" | ||
| # safari: "14.1" | ||
| # safari_ios: "14.5" | ||
| - api.AudioParam.cancelAndHoldAtTime |
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 and the next is correct, see mdn/browser-compat-data#23628.
| # edge: "12" | ||
| # safari: "6" | ||
| # safari_ios: "6" | ||
| - api.AudioParam.exponentialRampToValueAtTime |
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.
BCD has notes linking to bugs for these.
| # edge: "102" | ||
| # firefox: "70" | ||
| # firefox_android: "79" | ||
| - api.AudioContext.outputLatency |
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.
| # support: | ||
| # firefox: "68" | ||
| # firefox_android: "68" | ||
| - api.AudioContext.createMediaStreamTrackSource |
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 seems correct. I've sent mdn/browser-compat-data#23629 to make it even more easily verifiable next time around.
| @@ -0,0 +1,190 @@ | |||
| name: Web Audio | |||
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.
Should the name be "Web Audio" with Audio capitalized? "Web audio" looks wrong to me because it's not about audio generically, but this specific API. "Web Audio API" is the spec name.
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.
Web Audio feels much better. That's how everybody talks about it.
|
I think this is OK to land as-is. |
Co-authored-by: Patrick Brosset <[email protected]>
ddbeck
left a comment
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.
I'm happy with this, though please fix the style nit I noted in a comment. Thank you!
Co-authored-by: Daniel D. Beck <[email protected]>
No description provided.