Rantanen / node-mumble

Mumble client in Node.js
MIT License
155 stars 48 forks source link

How to get constant output? #38

Closed timeDev closed 9 years ago

timeDev commented 9 years ago

I was trying to play an mp3 like in the example and I noticed some extreme stuttering. So I tried the sin example as well and there too, I noticed that the output was pausing every four seconds or so, as well as stuttering slighly. What might be the cause of this? And how can I fix it so that it outputs a constant sound?

Rantanen commented 9 years ago

I've been tracking down some audio quality issues and I'm not really sure what causes them. However there shouldn't be any extreme issues.

Can you check the audio bandwith allowed by your Mumble server? I believe you can see this with Information in the Server menu (Alt+e, i).

Also does the stuttering go away if you go to your Mumble client configuration > Audio Output and raise the Default jitterbuffer option all the way to 50ms?

Currently the MumbleConnection doesn't abide by the max_bandwith server config. You can manually reduce the bitrate by calling MumbleClient.connection.setBitrate. If the client is sending more data than the server allows, the server just drops packets at will.

The harder issue is timing the packets. The packets need to come as a steady stream and MumbleInputStream.js tries to maintain that but for some reason it's not working perfectly (at least for me raising the default Jitterbuffer value in Mumble client makes things better). One option I've came up with is that Mumble clients buffer few extra packets when the voice transmission starts to make sure the recipients are never exhausted of packets but this is just speculation.

timeDev commented 9 years ago

Ok, it seems to be working now, thank you! My server has a bandwidth of 72kbit/s and I was streaming at 256kbit/s. I got it to work by setting the bitrate to somewhere around 36000. I'm probably going to go with less than that, as I don't want to hinder people chatting in other channels. By the way, changing the default jitterbuffer option didn't really do anything for me, but I got it working now so I'm happy!