mediasoup-client cannot support iLBC

I am trying to implement iLBC as audio codec, but device.canProduce(‘audio’) return false.
I am using chrome 87, vp9 as video codec. but switch to opus is fine.
iLBC setting is

	kind         : 'audio',
	mimeType     : 'audio/iLBC',
	clockRate    : 8000

thanks very much for your help

Returning false literally means that browser doesn’t support it.
Why would you want to use iLBC instead of Opus though?

I think chrome support iLBC, from Codecs used by WebRTC - Web media technologies | MDN.

I want to use iLBC to support unreliable network and to save bandwidth if there are many users to join the meeting.

mediasoup supports iLBC at 8000hz as the docs says.

However, no idea whether you have read the docs and enabled such a codec in the mediasoup Router or not.

My Chromium Nightly doesn’t support it either and I don’t think you will save a lot of bandwidth comparing to Opus (which has 2 modes of operation internally depending on content).

Also by using something like iLBC (which is not mandatory to implement by browser) you’re cutting off users of other browsers that will not be able to hear anything if their browser doesn’t support it. Unless you have to interoperate with legacy systems that don’t understand Opus and want to avoid audio transcoding, don’t bother with anything else, seriously.

Thanks @nazar-pc , I have also tested mediasoup-demo, same code just replaced audio codec in config file. but it looks chrome does not support iLBC.

I dont understand what it means:

how can I save bandwidth by using Opus?

You can tweak bitrates, but generally Opus is a codec that should detect that you only really use voice and switch to a version of it that is more suitable:

The format has three different modes: speech, hybrid, and CELT. When compressing speech, SILK is used for audio frequencies up to 8 kHz. If wider bandwidth is desired, a hybrid mode uses CELT to encode the frequency range above 8 kHz. The third mode is pure-CELT, designed for general audio. SILK is inherently VBR and cannot hit a bitrate target, while CELT can always be encoded to any specific number of bytes, enabling hybrid and CELT mode when CBR is required.

Thanks @ibc and @nazar-pc , I can prove that chrome does not support iLBC now, from createOffer() output

It looks both chrome and mediasoup only support 48kHz Opus, so there is no way to tweak bitrates.

This statement is far from realistic. You assume that audio bitrate depends on encoding clock rate. Well, not true at all.

Thanks @ibc , you are right, clock rate and bitrate are different. But I tried this morning to change bitrate for Opus in micproducer in mediasoup-demo, from

this._micProducer = yield this._sendTransport.produce({
      codecOptions: {
               opusStereo          : true,
               opusDtx               : true


this._micProducer = yield this._sendTransport.produce({
      codecOptions: {
               opusStereo          : false,
               opusDtx               : true,
               opusFec              : true,
               opusPtime           : '3',
               opusMaxPlaybackRate : 16000
     encodings: [{maxBitrate: 16000}]

then I found local audio stats still not changed, as:

id "RTCCodec_0_Outbound_111"
timestamp 1612110788046
type "codec"
payloadType 111
mimeType "audio/opus"
clockRate 48000
channels 2
sdpFmtpLine "stereo=1;usedtx=1"

I checked in chrome://webrtc-internals/, sdp is same as above.

And in AUDIO PRODUCER REMOTE STATS, bit rate is as same as before.

Did I do something wrong or Opus bitrate in Chrome (I am using Chrome 88) cannot be changed?

Do you find Opus codec really being a bottleneck or cause any kind of issue so you’re trying to optimize it further?

I am testing GitHub - edumeet/edumeet: Multiparty web-meetings using mediasoup and WebRTC, similar like mediasoup-demo, these days. It works fine in good network. but one of my friend told me that he was always forced to leave the meeting room when he wanted to speak. his network is a little slow, but never found problems to use zoom meeting room. So I think this maybe caused by too much audio bandwidth.
But this problem only happens when there are 11 testers join in the meeting room. I only invited him to join the meeting room, then he can speak with me normally and not forced to leave room.

I think I need to figure out why webrtc and is disconnected too.