Lurker News
I originally developed a WASM port of wxWidgets for https://dj.app/. When it came time to open source wxWidgets-wasm, I decided to port another complex app as a test case, and Audacity seemed like the obvious choice. In the process, I also needed to write a new host API for PortAudio for playback and recording in the browser.

https://github.com/ahilss/wxWidgets-wasm
https://github.com/ahilss/portaudio-wasm
https://github.com/ahilss/wavvy

Comments (111) 39 threads

Earlier comments
flanbiscuit#
This is awesome! Bookmarking this for sure!

I really dig your dj.app, it looks a lot like an app I sometime I use called Mixxx[1], which is open source[2]. But I think it's built using QT instead of wxWidgets. Anyways, now that I know there's a similar web-app available I might start trying dj.app out! thanks!
1. https://mixxx.org/ 2. https://github.com/mixxxdj/mixxx

squarefoot#
I'm generally against web apps, but have to admit this one is really cool; it also loads surprisingly fast. So far the only difference with the original seems the waveform display which uses a smaller resolution, probably not to slow down too much the UI.
bluelightning2k1 reply#
This seems like a really impressive technical work. Well done! I'd be interested in a write up of the process
stjohnswarts#
Me too. Maybe just a blog post with the big details and some lessons learned. I tried a Qt app once to wasm. and it was just painfully slow and so buggy when I got done (mostly just unexplained crashes). I'm no pro though, it was just a weekend project.
paulgb3 replies#
Cool! The UI even works on iPhone (alas, playback doesn’t work, so my dreams of multitrack audio editing with just my thumbs are dashed /s)

I’m curious what porting wxwidgets involved — are you rendering them with the 2D canvas API, WebGL, or is all the rendering done by WxWidgets and you just have to send a framebuffer into a canvas?

samwillis#
Not the OP, but taking a look at the DOM, it's rendering each "window" as a canvas. So you have a main window canvas, then canvases for popup menus, message boxes etc. All canvases are using a 2d context, and there are many offscreen canvases created for each interaction for each widget which I assume are then composited to the window canvases.

It's an amazing project! If the OP is here, do you have any plans for accessibility to screen readers? I suppose it's a similar problem to that with Flutter.
I also wander if there is a possibility to combine your wxWidget port with the work going into WASM Python...
Edit:
Taking a closer looks at how the wxWidget port works, wxWidgets has multiple backends using native widgets on each platform. They also have wxUniversal which draws each widget itself to a frame buffer, this port uses that as a base to draw the ui to html canvases.

tobsterius#
Doesn't the iOS version of GarageBand allow for multi-track editing?
ahilss#
It is rendering using the 2D canvas API. There's a device context class (wxDC) for each wxWidgets port that implements primitive drawing ops (DrawLine, DrawText, etc). For the WASM port, I created a glue library in javascript [1] that wxDC calls into for each primitive.

[1] https://github.com/ahilss/wxWidgets-wasm/blob/master/build/w...

Load more comments