Restrict Audio sampling rate to 16 kHz

Hi all,

Iwould like to restrict audio sampling rate to 16 kHz. At one of Jitsi calls I have heard this is impossible to do it in frontend.
But it is possible to do it by setting SDP sesion parameters.

How can I do it? I was looking into Jicofo, but haven’t found any place there where SDP session is handled.
May be this can be not into Jicofo or anywhere else?

Thanks in advance for your help!!

Regards,
Ivan

Any update?

I think you should change it in the client: https://github.com/jitsi/lib-jitsi-meet/blob/master/modules/RTC/RTCUtils.js#L359
Why you want to change that?

Hi @damencho! Thanks for the reply!
I would like to restrict audio sampling rate to optimize consumed bandwidth.

I took a look at https://github.com/jitsi/lib-jitsi-meet/blob/master/modules/RTC/RTCUtils.js#L359. It looks like there is no way to set up particularly audio sampling rate there. What I see there, is the ability to change audio params like echoCancellation, noiseSupression, highPassFilter etc. But nothing like sampling rate, frame rate or similar.

You can https://blog.addpipe.com/audio-constraints-getusermedia/
We don’t have such setting, that’s why I sent you the source code where you need to apply your changes.

Are you sure that you will have any big improvement with opus and changing the sample rate? I think I have seen some studies about opus that it is pretty optimised right now and doing that change will not give you the desired optimisation at all.

@damencho, thanks for the reply!
Well, not sure audio sample rate constraints will bring some meaningful difference, but at least I want to implement it and the try it and measure the difference.

Ivan, reducing the sampling rate is not a good way to optimize bandwidth. You should instead restrict the bandwidth and let the opus encoder adapt. I’m not sure if this is easy with jitsi, but you can see what the SDP should look like here:
https://webrtchacks.com/limit-webrtc-bandwidth-sdp/

Boris