-
Notifications
You must be signed in to change notification settings - Fork 200
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
FreeQueue + WASM example #255
base: main
Are you sure you want to change the base?
Conversation
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.
The PR generally looks great! Let's make some improvements over comments. Also README file with some explanations for each file would be really helpful.
src/audio-worklet/free-queue/examples/hello-webassembly/build/example.worker.js
Show resolved
Hide resolved
src/audio-worklet/free-queue/examples/hello-webassembly/example.c
Outdated
Show resolved
Hide resolved
src/audio-worklet/free-queue/examples/hello-webassembly/sink-processor.js
Outdated
Show resolved
Hide resolved
src/audio-worklet/free-queue/examples/hello-webassembly/sink-processor.js
Outdated
Show resolved
Hide resolved
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.
Please pay attention to the style and comments.
One big question is: can we handle the stereo properly?
Other than that, I believe we can wrap this up in the next round of code review.
src/audio-worklet/free-queue/examples/hello-webassembly/README.md
Outdated
Show resolved
Hide resolved
src/audio-worklet/free-queue/examples/hello-webassembly/example.c
Outdated
Show resolved
Hide resolved
src/audio-worklet/free-queue/examples/hello-webassembly/example.c
Outdated
Show resolved
Hide resolved
src/audio-worklet/free-queue/examples/hello-webassembly/sink-processor.js
Outdated
Show resolved
Hide resolved
|
||
// Pull out render quantum frame from the queue into output. | ||
// If failed, print "failed" to console. | ||
const didPull = this.queue.pull(output, RENDER_QUANTUM); |
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.
Perhaps:
return this.queue.pull(output, RENDER_QUANTUM) ? true : false;
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 don't think we can return false
here.
Then I think audio worklet will just stop 🤔
https://webaudio.github.io/web-audio-api/#callback-audioworketprocess-callback
So I think we should always return true, to keep worklet alive
So here it is!
WebAssembly Example
Hello WebAssembly Example
It takes some time for audio to start, cause of silence in start of audio