webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

Default audio channels number

Open N1cOs opened this issue 5 months ago • 1 comments

Your environment.

  • Version: v4.1.1 (also the same behaviour for latest master)

What did you do?

After updating Pion to version 4.1.1, we encountered an issue when using the G722 codec. In PR #3021, logic was changed that codec matching is no longer based only on mimeType and fmtp parameters. Now it also checks the sample rate and number of channels.

In our case (and it's default for Chrome), sender in SDP announces a=rtpmap:9 G722/8000. According to RFC 4556 it indicates 1 channel:

For audio streams, <encoding parameters> indicates the number of audio channels. This parameter is OPTIONAL and may be omitted if the number of channels is one, provided that no additional parameters are needed.

However, current implementations of codecsFromMediaDescription use 0 channels as default. Should we align its logic with RFC?

What did you expect?

1 audio channel number after decoding SDP description for a=rtpmap:9 G722/8000

N1cOs avatar May 22 '25 13:05 N1cOs