layeh / gumble

gumble is a Mumble client implementation in Go (golang)
https://pkg.go.dev/mod/layeh.com/gumble
Mozilla Public License 2.0
172 stars 53 forks source link

Set opus bitrate within default max bandwidth #3

Closed ers35 closed 9 years ago

ers35 commented 9 years ago

The Opus bitrate was set to 40000 in a previous version of piepan: https://github.com/layeh/piepan/blob/d4033fcf68c6fe9b708f16d6bb025c1bf28bdbd2/src/piepan.c#L358 The bitrate is no longer set, so Opus uses 72000. This is larger than Murmur's max bandwidth default setting, causing audio skipping.

As your TODO indicates, the max bitrate should be calculated based off the server's max bitrate. See https://github.com/mumble-voip/mumble/blob/acf73f58153c6d53182087302038dd0cc639d9d1/src/mumble/AudioConfigDialog.cpp#L260

ghost commented 9 years ago

I don't think having the the library itself set the bitrate automatically is a good idea. My thinking is that it will get in the way if the user tries to override the value. However, this change is acceptable since it's just setting the initial bitrate to something reasonable.

Currently, barnard is very lazy and just sets the bitrate to 1/3 of the maximum (which is not a good formula). Maybe we can add a helper function to calculate a decent bitrate?

Included your change as bc9109ac77305ea161037a719f38e9c60c3288f7.

ghost commented 9 years ago

8215d611d67473776438d091278bf21f53df183b improves on this.