SolarLiner/interflow

Web support

Open

#21 opened on Mar 10, 2025

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Rust (4 forks)auto 404
B-WASMP-Webfeaturehelp wanted

Repository metrics

Stars
 (64 stars)
PR merge metrics
 (PR metrics pending)

Description

Problem Statement

Add support for Web Audio.

Proposed Solution

It's unclear what the solution should be.

There are two approaches:

  1. Create a separate module for running in a Web Audio node. This is the better performance option, separates concerns and does not block the main thread (nor competes with it for timeslices). However, SharedArrayBuffers are not available unless a specific security context is active; in practice, unless the user can configure the headers the HTTP server sends with the payload that will instanciate the module, this is not available to us.
  2. Schedule the audio callbacks on the main thread at regular intervals, and use a ring buffer to pop audio data from the Web Audio node. This approach is available everywhere, and has been used in other projects, but is the cause of performance issues on the web.

Checklist

  • I have searched for existing issues that may be similar
  • I have explained the feature's value proposition
  • I have provided concrete examples

Contributor guide