I'm working on a project where audio data is streamed to a device. The audio data is encoded via opus and streamed at 20 ms payloads at a time. The streaming is done via TCP to avoid packet loss completely. The goal of the streaming is to have as close as possible to live audio streaming, without audio loss, or jittering.Currently what happens on slower Internet connections, the audio may jitter a little bit. I am not using any buffers currently, but the goal is to be able to have as close as possible to live streaming but at the same time eliminating the jitter.I've looked into jitter buffers, and it seems that jitter buffers also are supposed to handle delays on both end so that both ends are as in-sync as possible, which sounds like overkill for my situation. I'm afraid that if I make a static buffer size, it will take away from the live streaming aspect if this isn't necessary.So this leaves me with a few questions, that are all somehow related.What is a good method or algorithm for detecting the buffer length?What's the best way to start feeding data to the decoder on the receiver end? Is it when the buffer reaches a certain amount of milliseconds full it'll start feeding data in 20 ms payloads?Do I delay playing if the buffer gets underfilled?Will the buffer be in bytes or time length?Thanks so much!
What type of buffer should I implement for a one-way streaming audio device?
algorithms;stream processing;buffers