Closed justinmchase closed 9 years ago
Upping the quality on my server fixed the issue completely. I would still to know how to lower the quality here and then possibly create a PR to dynamically downgrade based on the server options like the official mumble client does. We will have a variety of users with various quality computers, supporting lower quality streams coudl be very useful.
Sample rate is quite a bit different when it comes to compressed audio. Even 8kHz sample rate with 16 bit samples would equal 128kbit/s bitrate uncompressed - and given opus/celt use fixed bitrate that wouldn't reduce the bandwith at all.
MumbleConnection should have setBitrate exposed which . One of the Mumble server messages contains the capped bitrate.
The server's max bitrate is part of the ServerConfig
message. Should be a simple case of calling the this.setBitrate
in MumbleConnection
when receiving new ServerConfig
.
I'd do this, but I don't have a low bitrate murmur server currently. If you got one, you could make the change and confirm it fixes the issue?
Cool, I will give it a shot and let you know. Thanks.
Reopening. Waiting for confirmation.
We reconfigured our server up to 48000 to resolve this but I will lower it again and test this soon. Thanks again.
Also I have a related question for you. We upped the quality on the server and now audio is going through it fine, except that the sent voice sounds high pitched, chipmunk-like. The incoming audio sounds fine however.
I think that the browsers getUserMedia
api is grabbing mic data at a sample rate of 44.1khz. I'm thinking what I need to do is to up-sample to 48khz, then let node-mumble do the rest. Does that sound right?
I'm looking at this for example: http://stackoverflow.com/questions/27411835/web-audio-api-downsample-44-1-khz-in-javascript
The input stream constructor should take in options that allow specifying sample rate or something...
I know I wrote code to quickly resample audio somewhere.
Maybe take a look at: https://github.com/Prior99/node-samplerate It seems to be pretty stable since many weeks.
:+1:
@Prior99 I'm noticing that libsamplerate is GPL licensed... that could be a problem. I'm happy to use your node-samplerate addon as is but I'm not sure if consuming it would force my electron application to also become GPL licensed? We're looking into it.
As I mentioned earlier, the MumbleInputStream
constructor accepts the expected sample rate as an option. These options can be passed in when calling inputStream()
.
The actual resampling implementation is quite naive but it should do the trick unless you really require high fidelity audio.
The options are somewhat documented in the Wiki as well, although the connection between inputStream()
parameters and MumbleInputStream
constructor options isn't really spelled out.
Yeah, I'm going to use that. Thanks @Rantanen
@justinmchase yes, that is a problem. It uses libsamplerate which is gpl licensed so there is no way to change it :/
I'll close this and reopen a new one for improving the bitrate limiting logic.
Actually, sorry for not following up but using the inputStream trick like you suggested worked for me. I ended up going with the openal approach, which lets me just set it right to 48000, but when I was in the browser it was necessary to set it to 41000.
I'm having trouble sending audio. When I am listening and someone else is send me audio everything is fine. When I send audio however it sounds garbled to listeners.
For now I am just using the loopback.js example so I can send and receive audio myself. I've tried the demo on both windows and linux so far and both are having the same issue. I'm now wondering if the issue is now a server configuration issue?
When I connect the real mumble client to my server I get this message:
I'm wondering if
node-mumble
is simply trying to send too high of bandwidth streams to the server and thus having problems. I tried setting thesampleRate
on the input options but it didn't seem to have an effect. I tried to patch node mumble to use a default of8000
instead of48000
for theSAMPLING_RATE
but it gives me this:warning: Sampling rate must be between 32 kHz and 96 kHz
So i have two questions:
node-mumble
so that it's only sending 8kbit/s ?