more test code (10% drop both directions)

This commit is contained in:
wangyix 2014-08-12 10:50:34 -07:00
parent a31d53544b
commit 8565e93ba4
3 changed files with 3 additions and 2 deletions

View file

@ -649,6 +649,7 @@ void AudioMixer::run() {
}
// send mixed audio packet
if (rand() % 100 < 90)
nodeList->writeDatagram(clientMixBuffer, dataAt - clientMixBuffer, node);
nodeData->incrementOutgoingMixedAudioSequenceNumber();

View file

@ -724,6 +724,7 @@ void Audio::handleAudioInput() {
}
int packetBytes = currentPacketPtr - audioDataPacket;
if (rand() % 100 < 90)
nodeList->writeDatagram(audioDataPacket, packetBytes, audioMixer);
_outgoingAvatarAudioSequenceNumber++;
@ -776,8 +777,6 @@ void Audio::addLastFrameRepeatedWithFadeToScope(int samplesPerChannel) {
addBufferToScope(_scopeOutputLeft, _scopeOutputOffset, lastFrameData, samplesToWriteThisIteration, 0, STEREO_FACTOR, fade);
_scopeOutputOffset = addBufferToScope(_scopeOutputRight, _scopeOutputOffset, lastFrameData, samplesToWriteThisIteration, 1, STEREO_FACTOR, fade);
printf("scopeOutputOffset %d\n", _scopeOutputOffset);
samplesRemaining -= samplesToWriteThisIteration;
indexOfRepeat++;
} while (samplesRemaining > 0);

View file

@ -519,6 +519,7 @@ void ScriptEngine::run() {
memcpy(audioPacket.data() + numPreSequenceNumberBytes, &sequence, sizeof(quint16));
// send audio packet
if (rand() % 100 < 90)
nodeList->writeDatagram(audioPacket, node);
}
}