If i add the two tones then the result if two peaks are added together will be greater then the the sample max (2^15).
For the life of me I couldn't think of the right words to google. Think i have google block.
If i add the two tones then the result if two peaks are added together will be greater then the the sample max (2^15).
For the life of me I couldn't think of the right words to google. Think i have google block.
If you can't tolerate any distortion, then divide by 2 the amplitude of the signals you want to mix.
You need to attenuate the signals. Either by reducing the gain using a gain fader control on each signal prior to mixing them or applying a compressor to each channel so that when combined they do not exceed unity.
The "Mixing 2 or more sound signals together" thread in the March 2004 archives of the MusicDSP mailing list archive (http://music.columbia.edu/pipermail/music-dsp/2004-March/subject.html) is worth a read.