I've been developing an audio conference application with Web Audio API and Node.js. One person will speak and other clients who are connected should hear him.
On the client-side I'm encoding PCM samples with libopus before sending them into server.
On the server-side I'm just sending those encoded packets back to users who are connected, and finally on each client I'm decoding those packets back to samples that can be played with Web Audio API.
When I'm testing the application on local environment everything is working just fine. On production environment, when the clients can connect from outside local space, couple major problems will occur.
Some clients will have a delay in their audio which seems to be increasing. For example, if the stream has been going on for 1min the delay for some clients can be as big as 10 seconds, and after couple of minutes the delay for some clients is even bigger 30-50 seconds.
Some clients have no problems.
Especially the clients that are experiencing the delay, the sound is extremely low-pitched. This can happen for the clients who have no delay in their audio aswell.