-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: added missing options to EmscriptenAudioWorkletNodeCreateOptions closes #23982 #25497
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
base: main
Are you sure you want to change the base?
Conversation
system/include/emscripten/webaudio.h
Outdated
// Extended options from AudioWorkletNode | ||
int channelCount; | ||
int channelCountMode; | ||
int channelInterpretation; |
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.
channelCountMode and channelInterpretation are strings, so an integer will not work.
Create an enum for those, and in the JS code, index the enum into an array of strings.
See e.g. https://github.com/juj/wasm_webgpu/blob/3ed529956d1ee3f14f64c07769385e1929908f68/lib/lib_webgpu.js#L615 and https://github.com/juj/wasm_webgpu/blob/3ed529956d1ee3f14f64c07769385e1929908f68/lib/lib_webgpu.js#L729 in another repo for examples.
system/include/emscripten/webaudio.h
Outdated
int numberOfOutputs; | ||
// For each output, specifies the number of audio channels (1=mono/2=stereo/etc.) for that output. Default=an array of ones for each output channel. | ||
int *outputChannelCounts; | ||
// Extended options from AudioWorkletNode |
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 comment documents the history of evolution of the codebase (i.e. "before this PR, we had a 'basic' set, after this PR, we now have 'extended' set"), but in the Web Audio specification, there is no distinction between basic and extended options - there are just options.
So instead of documenting history of evolution, maybe add short comments that describe the new parameters?
@juj how do i run test cases locally? I followed the docs but I'm facing some issues while running these commands
|
Yeah, that is how you install a pre-compiled Emscripten. If installing To run browser audio-related tests, you can run If installing |
Problem Description
The EmscriptenAudioWorkletNodeCreateOptions struct currently only exposes options specific to AudioWorkletNode itself (numberOfInputs, numberOfOutputs, outputChannelCounts), but AudioWorkletNode inherits from AudioNode which has additional properties:
Fix
system/include/emscripten/webaudio.h
.src/lib/libwebaudio.js
to pass these options to theAudioWorkletNode
constructor.Closes #23982