fixes conference audio problem. introduced 20ms mixer delay may be optimized.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@73 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 20 years ago
parent 08432ee219
commit a33978ea3b

@ -35,6 +35,10 @@
// PCM16 range: [-32767:32768]
#define MAX_LINEAR_SAMPLE 32737
// the internal delay of the mixer (between put and get)
#define MIXER_DELAY_MS 20
#define MIXER_DELAY MIXER_DELAY_MS*8 // 8000/1000
AmMultiPartyMixer::AmMultiPartyMixer()
: channels(),
cur_channel_id(0),
@ -87,12 +91,13 @@ void AmMultiPartyMixer::PutChannelPacket(unsigned int channel_id,
if((channel = get_channel(channel_id)) != 0){
unsigned samples = PCM16_B2S(size);
channel->put(ts,(short*)buffer,samples);
mixed_channel.get(ts,tmp_buffer,samples);
unsigned int put_ts = ts + MIXER_DELAY;
channel->put(put_ts,(short*)buffer,samples);
mixed_channel.get(put_ts,tmp_buffer,samples);
mix_add(tmp_buffer,tmp_buffer,(short*)buffer,samples);
mixed_channel.put(ts,tmp_buffer,samples);
mixed_channel.put(put_ts,tmp_buffer,samples);
}
else {
ERROR("MultiPartyMixer::PutChannelPacket: "

Loading…
Cancel
Save