Skip to content

Platform/wasm browser#109

Draft
KieranFoot wants to merge 13 commits into
LSXPrime:platform/wasm-browserfrom
KieranFoot:platform/wasm-browser
Draft

Platform/wasm browser#109
KieranFoot wants to merge 13 commits into
LSXPrime:platform/wasm-browserfrom
KieranFoot:platform/wasm-browser

Conversation

@KieranFoot
Copy link
Copy Markdown

@KieranFoot KieranFoot commented Apr 19, 2026

Working on fixing Blazor WASM support.

Todo list:

  • MiniAudioEngine.DataCallback cannot be used as-is in WASM.
  • Synchronous Stream IO not supported in the browser.
  • Monitor.Wait() not supported on browser. (Used manually and in Task.Wait())
  • System.Security.Cryptography.ECDsa not supported in the browser.
  • System.Security.Cryptography.AES not supported in the browser.
  • Browser file stream cannot use Seek() and must be wrapped in a MemoryStream or another fix found.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to SoundFlow repository! We appreciate you taking the time to contribute.

We're excited to review your pull request and look forward to collaborating with you. Please let us know if you have any questions or need any assistance.

Thank you for your contribution!

…to replace AES and ECDsa usages that are not usable in the browser.
@KieranFoot
Copy link
Copy Markdown
Author

I have successfully found all code that is not compatible with the browser and annotated it as such.

Unfortunately, to finish WASM compatibility, a considerable amount of code will have to be re-written to use asynchronous stream IO exclusively and to take out all uses of Task.Wait() and Monitor.Wait().

Also, the frameworks implementations of Aes and ECDsa are not supported in the browser and will need to made to use implementations from the BouncyCastle.Cryptography library instead.

…fic implementations for unsupported APIs. Updated Emscripten paths and dependencies for WASM builds.
@KieranFoot
Copy link
Copy Markdown
Author

Since many implementations of ISoundDataProvider read data from a stream in their constructors, I propose moving the constructor code to an Initialize() and / or InitializeAsync() method allowing for the inner stream IO to be fully asynchronous when required.

Also, I propose the addition of ReadBytesAsync() for use in the browser.

@LSXPrime LSXPrime linked an issue May 11, 2026 that may be closed by this pull request
@LSXPrime
Copy link
Copy Markdown
Owner

Great job on this.

I think this PR should wait for v2.0, which I’m planning to release in 2027. so we have all the time we need.

My roadmap for v2.0 includes:

  • Moving to async/await where possible.
  • Fixing remaining seeking issues.
  • Upgrading to .NET 10.
  • Splitting the library into smaller modules instead of one monolithic package.
  • Adding ASIO backend support.
  • Exploring a Unity module (though this might require backward compatibility with .NET Standard 2.0).

I still prefer to keep this a zero-dependency library, so adding BouncyCastle.Cryptography isn’t ideal. But since I have a year to solve these challenges, I’m sure we can figure out a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Any plans to support WASM / Browser?

2 participants