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

Configurable audio packets interval #7

Closed neckcen closed 9 years ago

neckcen commented 9 years ago

(Feature request)

Currently the interval at which audio packets are sent is hardcoded as 10milliseconds. This seems to produce choppy sound for me when using 10ms buffer in mumble. Would it be possible to allow custom audio interval values?

ghost commented 9 years ago

Added in 334bf392186d083094a71c3062c18f0d8dfe0bdb.

neckcen commented 9 years ago

Did a quick test using the audio-player.go example with config.AudioInterval = 40 * time.Millisecond added and the sound is badly mangled (same with 20 and 60ms).

My own knowledge of Go proved itself insufficient to locate the source of the problem, sorry!

ghost commented 9 years ago

The decrease in audio quality is likely due to Config.AudioDataBytes having a low value compared to the new interval. You can either:

  1. Manually change Config.AudioDataBytes to a larger value, or
  2. Use gumbleutil.AutoBitrate, which automatically sets Config.AudioDataBytes, based off of the server's maximum bitrate.
neckcen commented 9 years ago

Adding client.Attach(gumbleutil.AutoBitrate) did change Config.AudioDataBytes value but did not help with sound quality.

ghost commented 9 years ago

Can you make a recording of the audio and share it? Also, what is the bitrate of your server? It's worth nothing that it was reported that audio transmission does not work well on low-end devices such as the Raspberry Pi.

neckcen commented 9 years ago

Server bitrate is 72kb/s (hosted on a server with 10mbs bandwidth). For the purpose of testing I am running the program from my desktop computer so performances shouldn't be an issue.

30s recordings straight from mumble: