Re: [webrtc-pc] Remote track.getSettings().channelCount (#3011)

After discussions with @padenot, we've found value in returning channelCount 1 when a stereo capable decoder is receiving mono packets. This information isn't readily available elsewhere, and seems useful for websites to cut downstream processing in half.

Running this fiddle in Firefox¹ https://jsfiddle.net/jib1/jn5789vw/ shows the situation in practice:

<img width=800 src="https://github.com/user-attachments/assets/b333debc-2322-42cd-a2a7-b9e477424ca6">

It shows a mono microphone track sent over a peer connection is received as a stereo track², because opus. That's fine.

But once we check `✅ Mid/Size transform` to [mid/side process](https://majormixing.com/what-is-mid-side-encoding/) the audio, we see that it's really mono.

We think websites will want the receiver.track's`channelCount` to reflect what the other side is sending. If you switch to a stereo microphone in the fiddle, we think this should update receiver.track's `channelCount` and fire [`onconfigurationchange`](https://w3c.github.io/mediacapture-extensions/#dom-mediastreamtrack-onconfigurationchange) on it.

---
<sub>1. Unfortunately, Chrome won't let me open a mono microphone, and Safari doesn't appear to negotiate stereo reception by default, so please run it in Firefox.</sub>
<sub>2. Note the "Logitech BRIO channelCount = 1" log statement is about the local side despite its placement.</sub>



-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/3011#issuecomment-2762411138 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 28 March 2025 20:35:09 UTC