audiojs/audio-speaker

Inconsistent output for different number of channels

Opened this issue · 0 comments

dy commented

If we pick {channels: 1} but the input stream is stereo, and vice-versa, we get improperly scaled playratio.

The expected behaviour would be down/up-mixing the channels, like putting mono to the left 1 → 2 case, averaging stereo in 2 → 1 case, etc. See table.

Also that may consider up/downsampling, and in broader sense any input pcm format.

That might be a concern of a separate module, like audio-pcm-format, though I guess it is natural to expect from speaker to properly output any pcm format, if explicitly defined.

So that’s a tough one.