Back to Hub
MEDIA PIPELINE • MAY 2026

Sub-20ms Voice Chat via AudioWorklet & WebRTC.

When implementing pair programming, text isn't enough. You need seamless voice communication. Unfortunately, standard HTML5 <audio> tags and traditional WebRTC streams are tied to the browser's main thread. If the IDE is compiling a massive AST, the main thread stutters, causing the audio to clip, pop, and lag.

To achieve Discord-level voice quality inside a browser IDE, NitroIDE entirely bypasses the main thread using the Web Audio API's AudioWorklet interface.

The Audio Rendering Thread

AudioWorklet allows us to execute custom JavaScript audio processing scripts in a dedicated, high-priority audio rendering thread. When your microphone captures a raw PCM (Pulse-Code Modulation) stream, the AudioWorklet intercepts it, applies client-side noise suppression, and pipes the buffer directly into the WebRTC stream without touching the UI thread.

// Initializing an AudioWorkletProcessor in a dedicated thread
class NitroVoiceProcessor extends AudioWorkletProcessor {
  process(inputs, outputs, parameters) {
    const input = inputs[0];
    const output = outputs[0];
    for (let channel = 0; channel < input.length; ++channel) {
      // Apply noise gate and copy PCM buffer to output
      output[channel].set(input[channel]);
    }
    return true; // Keep processor alive
  }
}
registerProcessor('nitro-voice', NitroVoiceProcessor);

SharedArrayBuffer Integration: To display the active "Voice Volume" UI indicator in the editor, we don't use postMessage (which adds latency). The AudioWorklet writes the volume amplitude to a SharedArrayBuffer, which the main thread reads synchronously at 60fps for real-time visual feedback.

Eliminating Jitter

By keeping the audio encoding and decoding strictly within the AudioWorklet thread, we guarantee that compiling a 10MB JavaScript file will never interrupt your conversation. The result is a rock-solid, sub-20ms latency voice channel that rivals native desktop VoIP applications.

Talk in Real-Time.

Start a collaborative session and experience hardware-accelerated voice chat.

Launch Workspace