Re: [Audacity-devel] Where does LPCM down-mixing code live?
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Bob I. <bob...@br...> - 2010-08-16 02:09:06
|
On Sun, Aug 15, 2010 at 5:54 PM, Martyn Shaw <mar...@gm...> wrote: > Convert to float/double before all other operations? Then you won't get > the clipping of adding 16-bit floats together. Just a thought. > That makes sense, and that is what I am doing. However, after all of the sample addition has been completed, I still have to export the resultant downmixed stream back to a 16-but signed format, at which point, it will clip unless I apply some sort of constant scaling factor to scale the waveform back into the 16-bit domain. > > We do it (eventually) in Mix.cpp MixBuffers li317. > I read through Mix.cpp and saw that sample were simply added as floats (with what looked like an optional per-channel gain multiplier.) But I assume that the export function must take care of the scaling because that is where it is going to have to write-out the resultant file as 16-bit signed, 44.1KHz, etc (assuming that is what I tell it to export to.) > HTH > Martyn > > Thanks! > On 12/08/2010 03:58, Bob Ingraham wrote: > >> Hello, >> I have been attempting to implement a software-only Linear PCM >> down-mixing algorithm (i.e., combining multiple LPCM streams >> (16-bit-signed, 44.1KHz, 2-channel) into a LPCM single stream,) in Java >> but am having limited success with finding a good algorithm. >> Lots of Googling and experimentation but mediocre down-mixed results. >> Apparently, adding LPCM samples together and dividing by the total >> number of samples added, doesn't cut it... That's where I started and >> then went on tweaking from there, but the best result I get is that I >> can distinguish the individual source streams, but there's so much >> "static" noise introduced by my algorithm that it renders the result >> unuseable. >> So, I've downloaded the Beta source from SVN and am starting to go >> through it to see if I can find out how the experts do it. >> Which brings me to my question: Would someone be kind enough to point me >> to the part of the source tree that deals with down-mixing LPCM streams? >> Thanks, >> Bob >> >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by >> >> Make an app they can't live without >> Enter the BlackBerry Developer Challenge >> http://p.sf.net/sfu/RIM-dev2dev >> >> >> >> _______________________________________________ >> audacity-devel mailing list >> aud...@li... >> https://lists.sourceforge.net/lists/listinfo/audacity-devel >> > |