Persistent File System API within AudioWorkletProcessor #21085
Unanswered
terryzfeng
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Is there some reason why you need to use AudioWorklet for your use case? If you are simply playing files from the filesystem I think you can just use the normal emscripten audio capabilities, no? |
Beta Was this translation helpful? Give feedback.
1 reply
-
@juj, you might have more advice on the AudioWorklet front. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a project that utilizes Emscripten and a Web Audio AudioWorklet that makes different sounds when reading files in a file system. I want the AudioWorklet Processor to be able to read files (currently using libc). Because
AudioWorkletProcessor
Emscripten module runs on a separate audio rendering thread, I can't update my file system directly from the main thread, I can only do it on the audio thread viapostMessage
which is bad for performance. I also need to persist my file system so I'm trying to use IDBFS + IndexedDB.How can I access the EM_ASM
FS
object (in C which is compiled in the AudioWorkletProcessor) on the Main Thread so I can see and make changes to the file system?I've tried mounting an IDBFS folder so that my main thread could also read/write to IndexedDB in hopes that this would be possible with the following code:
However, when doing this in C in the AudioWorkletProcessor, I get this error:
Aborted(Assertion failed: IDBFS used, but indexedDB not supported)
Is there a better approach for doing this?
Beta Was this translation helpful? Give feedback.
All reactions