-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[AUDIO_WORKLET] Add multichannel audio tests. NFC #23394
base: main
Are you sure you want to change the base?
Conversation
I love that Tim Wright composed our audio tests :) Please tell him I was a great fan or Lemmings and Shadow of the Beast 2 back in the day. |
😁
Now we'll need to widen the office doors even more to let in his ego! |
EM_JS(EMSCRIPTEN_WEBAUDIO_T, createTrack, (EMSCRIPTEN_WEBAUDIO_T ctxID, const char* url, bool looping), { | ||
var context = emscriptenGetAudioObject(ctxID); | ||
if (context) { | ||
var audio = document.createElement('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.
Why are these two JS functions needed? Is this functionality not available though existing emscripten APIs?
Are folks expected to create their own audio elements like this?
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.
Yep, there's no provision (that I know of) to create audio tracks.
In reality the audio will probably come in via other means (we decode and mix Opus files, for example, or generate effects).
95edc47
to
28c72a5
Compare
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 wish I knew the audio worklet API better so I could give this a better review myself.
@juj perhaps you could review later if you get time?
lgtm to all the parts I could understand
The code that doesn't undergo a single change is now in its own file
cf4c0b9
to
2b6fe3e
Compare
These are the audio worklet tests from #22753 extracted to a standalone PR. The tests are:
The tests use different stack sizes (from 2kB to 6kB depending on the requirement).
The audio tracks were composed by Tim Wright especially for Emscripten and released under a CC0 license.
The tests can be run manually via:
There are no code changes to Emscripten apart from integrating the test.