Skip to content

Add WebIDLs for experimental AudioContext sinkId, setSinkId#3433

Merged
daxpedda merged 3 commits intowasm-bindgen:mainfrom
tylerbarker:main
Jun 13, 2023
Merged

Add WebIDLs for experimental AudioContext sinkId, setSinkId#3433
daxpedda merged 3 commits intowasm-bindgen:mainfrom
tylerbarker:main

Conversation

@tylerbarker
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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
Copy Markdown
Member

@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

@daxpedda
Copy link
Copy Markdown
Member

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

@tylerbarker tylerbarker requested a review from daxpedda June 12, 2023 14:04
Copy link
Copy Markdown
Member

@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.

@tylerbarker tylerbarker requested a review from daxpedda June 12, 2023 23:02
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
Copy Markdown
Member

Thanks @tylerbarker!

I just rebased and fixed the changelog.

@daxpedda daxpedda merged commit f569fdd into wasm-bindgen: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