Skip to content
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 WebIDLs for experimental AudioContext sinkId, setSinkId #3433

Merged
merged 3 commits into from
Jun 13, 2023

Conversation

tylerbarker
Copy link
Contributor

Hey, I'm working on some audio stuff and found these features I need were missing - thought it might be useful to contribute? Let me know if I'm missing something or have done this incorrectly. Cheers ✌️

@tylerbarker
Copy link
Contributor Author

Okay what I can gather from the failing CI is there's an issue because I mistakenly hard-coded the experimental feature decorators in gen_AudioContext.rs.

I can see now they need to be included in the unstable/ directory instead, how would I go about that given AudioContext is already stable? Is there a way I can write a partial IDL in unstable/ which I can include in the main IDL?

@daxpedda
Copy link
Collaborator

Yes, you should be able to use partial interface, it's used quite often in wasm-bindgen already.

Let me know if you encounter any problems.

@daxpedda daxpedda self-assigned this May 16, 2023
@daxpedda daxpedda added the waiting for author Waiting for author to respond label May 16, 2023
Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should implement the rest of the interface too:

  • AudioSinkInfo
  • AudioSinkOptions
  • AudioSinkType
  • BaseAudioContext.onsinkchange
  • AudioContextOptions.sinkId

crates/web-sys/webidls/unstable/AudioContext.webidl Outdated Show resolved Hide resolved
crates/web-sys/webidls/unstable/AudioContext.webidl Outdated Show resolved Hide resolved
crates/web-sys/webidls/unstable/AudioContext.webidl Outdated Show resolved Hide resolved
@daxpedda
Copy link
Collaborator

To generate the WebIDL correctly you have to run the following:

cd crates/web-sys
cargo run --release --package wasm-bindgen-webidl -- webidls src/features ./Cargo.toml

Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Missing an entry in the changelog.

crates/web-sys/webidls/unstable/AudioSinkInfo.webidl Outdated Show resolved Hide resolved
tylerbarker and others added 3 commits June 13, 2023 09:29
* added unstable AudioContext partial with audio sink types
* unrelated to sink, but I also added latencyHint to AudioContextOptions as it's stable
@daxpedda
Copy link
Collaborator

Thanks @tylerbarker!

I just rebased and fixed the changelog.

@daxpedda daxpedda merged commit f569fdd into rustwasm:main Jun 13, 2023
JolifantoBambla pushed a commit to JolifantoBambla/wasm-bindgen that referenced this pull request Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author Waiting for author to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants