How can we set bit width(bits per second) for PCMU codec audio in webrtc in flutter?

39 views Asked by At

I am using flutter_webrtc package for streaming video from a camera. There is a requirement to implement a two way communication in which the user can speak through the mobile and the audio can be played from camera and vice versa. The camera only supports PCMU as codec. I was able to set the PCMU as codec by editing SDP and setCodecPreferences function. But to receive the audio on camera side, we need to additional configuration to the audio like changing bit width, samples per frame etc.... Is there any possible ways we can achieve this?

1

There are 1 answers

0
Tsahi Levent-Levi On

PCMU is a speech codec and not a video codec. It uses static bitrate of 64kbps that cannot be changed. In a way, it is the most simplistic of speech codecs that has no compression used in it whatsoever.

If you want a better voice codec with WebRTC, then use Opus, where you can change bitrates.