use the attenuation ratio passed by an injected source

This commit is contained in:
Stephen Birarda 2013-06-05 16:46:07 -07:00
parent 58752d7e2d
commit 7715e58b3d
2 changed files with 5 additions and 1 deletions

View file

@ -33,7 +33,7 @@ int InjectedAudioRingBuffer::parseData(unsigned char* sourceBuffer, int numBytes
currentBuffer += sizeof(_radius);
unsigned int attenuationByte = *(currentBuffer++);
_attenuationRatio = attenuationByte / MAX_INJECTOR_VOLUME;
_attenuationRatio = attenuationByte / (float) MAX_INJECTOR_VOLUME;
currentBuffer += parseAudioSamples(currentBuffer, numBytes - (currentBuffer - sourceBuffer));

View file

@ -255,6 +255,10 @@ int main(int argc, const char* argv[]) {
otherAgentFreeVerb->setEffectMix(effectMix);
}
if (otherAgent->getType() == AGENT_TYPE_AUDIO_INJECTOR) {
attenuationCoefficient *= ((InjectedAudioRingBuffer*) otherAgentBuffer)->getAttenuationRatio();
}
int16_t* goodChannel = (bearingRelativeAngleToSource > 0.0f)
? clientSamples
: clientSamples + BUFFER_LENGTH_SAMPLES_PER_CHANNEL;