[gst-devel] audio/raw float caps format
David Schleef
ds at schleef.org
Mon Jun 30 13:29:16 CEST 2003
On Mon, Jun 30, 2003 at 01:15:24PM -0400, Leif Johnson wrote:
> The audioconvert plugin changes stereo to mono by averaging, right ? And
> mono to stereo conversion is just duplication ? Seems like any other
> methods would be less generally useful and require an app to use a
> mixmatrix for proper mixing of different channels.
>
> But if we extend that to multiple channels, I don't see why the
> audioconvert plugin couldn't do a simple average of N interleaved input
> channels to one output channel, and be able to duplicate one input channel
> to N interleaved output channels. Again, if the app requires more precise
> control over the mixing levels, it should use a mixmatrix. Thoughts ?
This seems like a reasonable simple approximation of doing the
right thing.
Changing stereo to mono by averaging the two channels is wrong.
However, in many situations, it yeilds acceptable results, which
I think is good for a simple element. A more correct algorithm
involves converting to a frequency-space representation and adding
the amplitudes of the right and left channels for each frequency.
Then you need to pick a phase for the resultant signal, which can
be a bit tricky.
dave...
More information about the gstreamer-devel
mailing list