# Proof-of-concept: Web based Jamulus client
First, here’s a demo:
# Quick facts
- Web Audio API can provide low latency audio access to audio output with base latency of 5.33 ms (buffer size of 128 samples) under
- WebRTC can create a low-latency UDP-like data channel under
ordered: false, maxRetransmits: 0settings. We also get end-to-end encryption for free.
- libopus can be compiled into WebAssembly and used inside an AudioWorklet.
- As of writing, all of the above is supported in the latest version of Safari on iOS.
# How it works
There are 3 main components:
- Source code: https://github.com/dtinth/rtcjam
- It should be run on the same server as the Jamulus server. It does nothing more than providing browser access to Jamulus server over a different transport layer.
- Since it will run on a publicly-accessible server, there will be no need to use STUN/TURN solutions.
- Once a WebRTC connection is established, all data will be forwarded to
localhost:22124(and vice versa).
Web-based Jamulus client.
# Limitations of the POC
- Right now it can only receive audio, as the encoder has not been implemented yet. The PoC is hardcoded to send silent Opus frames to the server.
- The PoC is hardcoded to use Stereo High Quality mode with 16 frames of jitter buffer. Client name is hardcoded to WebJam.
- The gateway server currently has no security mechanism at all; it accepts and forwards incoming UDP packets from any host (not just the target server).
Note: I have no intention to develop this any further. All this is just to satisfy my curiosity. However, I think it can be a good starting point to expand Jamulus to the web platform if anyone wants to pursue this goal.