Determine if a M4L device is getting mono or stereo audio
Jan 04 2020 | 1:31 am
Is there a way to tell if a M4L device is receiving stereo audio? I know I can do a null-sum check to see if the audio coming from both channels is the same or not, but what I would like to be able to do with that is to set a onebang-style flag where if the audio coming in is mono, I just sum it, process it in mono, and send it out both outputs (to save 50% of the CPU usage by muting the "R" polys), but if it's stereo, then process both channels independently.
I guess there are potential edge cases where the device may have mono audio coming in for a while, then a bit of stereo (or vice versa). In those circumstances I'd just default to once-stereo-always-stereo, just in case.
But yeah, is this a thing?