-
Notifications
You must be signed in to change notification settings - Fork 0
Help on a similar project #1
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
Comments
Hey @jacksongoode - thanks for reaching out, sounds like a cool project! Keen to help/collaborate if anything I've tinkered on here may be useful. I've succeeded in creating an AudioWorkletNode and accompanying AudioWorkletProcessor that runs DSP in WASM compiled from Rust. I first got an example working of just an infinite-looping sound file with some control over playback rate and then got distracted turning it into more of a granular synthesis patch (I plan on rescuing some of the more reusable bits from it at some point). (with lots of help from some things listed here, particularly this). Thanks for the links - I hadn't come across those before but will take a look (wasm memory is still pretty opaque to me tbh, I'm sure I'll learn more here). I've been meaning to document some learnings + failed experiments more meaningfully but in lieu of that here are a few stumbling blocks I hit and found work-arounds for. Hope its helpful - let me know if I can help or share more details! wasm-pack
I hadn't seen that blog you shared before (it would have been helpful!). But I think they get around this problem by instructing Memory
I have vague recollection of facing some issue with sound prior to moving all I suspect I could be handling memory more intelligently/safely here (if nothing more than just coupling Float32Array's and their rust memory references together) but still pretty new to this@ this repoHere's a bit more info on this repo in case it helps to make the code a bit more clear. Apologies for all the junk, I can probably clean some of it up this weekend:
How I set up/run/develop here roughly: npm link
cd demo
npm link wasm-audio-worklet # the name of the npm package at the root
# copy a sound file for the demo app (hard-coded as `sound-file.wav` for now...)
cp /path/to/some/soundfile.wav ./public/sound-file.wav
cd ../
# the repo root `package.json` shows all the other build steps (nothing fancy here)
npm run build
# the built demo app should now be in `demo/dist`
cd demo/dist
python -m http.server |
@jacksongoode FYI I've done some house keeping on
|
Thank you so much for the notes. I'm going to go through and attempt to reflect on these! |
Hey Jamie,
I've found we've been working on similar example implementations recently and was wondering you would want to collaborate or even have a look at an example I'm working on which is a peer-to-peer audio example where the audio buffer is modified through a worklet in Rust -> WASM. https://github.com/jacksongoode/decay It's super simple where the audio should just get processed as an octave lower on the receiving end.
I was wondering if you've gotten further than me and are actually processing audio through a WASM worker. I've taken the route of using the FreeQueue ring buffer which I feel like abstracts enough away to get working. I found this blog able to explain at a high level what should be happening with allocating memory in and out of two buffers.
But mostly just curious if you'd be able to provide some pointers in the right direction. I'm using wasm-webpack but maybe there's still some core incompatibility with AudioWorklets there.
The text was updated successfully, but these errors were encountered: