Real time stream playing in WebGL by AudioSorce with AudioClip

I’m experiencing an issue with real-time audio streaming in WebGL when using a looping AudioSource with a dynamically updated AudioClip. The audio playback is choppy.

_audioSource.loop = true;
_audioSource.clip = AudioClip.Create("VoiceChat", _bufferCapacity, 1, _frequency, false); // Streaming set to false

_audioSource.clip.SetData(_ringBuffer, 0); // update all clip with new data

Decompression is fast—significantly faster than the duration of a single audio packet. However, there is always not enough buffered audio in the clip for continuous playback, causing the AudioSource to stop until new audio data is written. This results in noticeable gaps and interruptions.

What are the best approaches for playing real-time voice audio in Unity WebGL?
Can this be achieved using Unity’s Audio API, or is it better to handle audio playback in JavaScript via the Web Audio API using a Unity WebGL plugin?

Don’t stream because WebGL is single-threaded. See WebGL Audio page which hints at this:

Unity WebGL partially supports AudioClip.Create. Browsers don’t support dynamic streaming, so to use AudioClip.Create, set the Stream to false.