Add support for playback in Electron apps #1933
Replies: 1 comment
-
In electron you have two parts: A node.js backend and a Chromium Frontend. The Node.js backend has no support for Web Audio. For now you likely need to use alphaTab both on the "backend" and "frontend" and communicate through channels. When using The Likely you are not using alphaTab/src/platform/javascript/BrowserUiFacade.ts Lines 112 to 117 in af692f2 I am not sure if there is a built-in way into Electron to use the Frontend APIs from the Node.js backend (e.g. simply doing a There is currently also no "NodeUiFacade" which could be used to run alphaTab (e.g. in a virtual/headless space which could be manually synchronized with an external UI). |
Beta Was this translation helpful? Give feedback.
-
Currently, when trying to create an
AlphaSynthWebWorkerApi
instance in the renderer process of an Electron app, an error is thrown (Workers not yet supported in Node.js
).But it should be possible to run the alphaSynth APIs in an Electron app, since it's basically a Chromium browser embedded in a desktop app. So this should be as simple as updating the detection logic to include this case, and check it with something like:
(source)
FYI, my use case is making an alphaTab plugin for Obsidian. I've tried running the above snippet in the console and it seems the detection logic is working. I can also see the
Worker
andAudioContext
objects are available, so alphaSynth should work out-of-the-box once the detection logic is updated.Beta Was this translation helpful? Give feedback.
All reactions