martindevans / MumbleSharp

An implementation of the mumble voice chat protocol in C#
http://martindevans.me
MIT License
91 stars 28 forks source link

Jitter buffer improvements #55

Open trevorirwin opened 4 years ago

trevorirwin commented 4 years ago

The very simple jitter buffer implemented in #54 is functional but very simple. There are many improvements that could still be made. Suggestions so far include:

martindevans commented 4 years ago

Detecting network traffic delay and dynamically adjusting the buffer length

The best approach to this would be to measure the standard deviation of elapsed time between packets arriving and set the buffer to some multiple of that.

Replacing the time-based delay with sample-based delay

This would be really nice for both testing and more exact timing (we're configuring everything with wall clock time, but really we don't care about that, just how many samples of time have elapsed in the audio system).

Dynamic Adjustment

This is surprisingly tricky to do. To expand or shrink the buffer you basically have two options: