Merge pull request #159 from birarda/audio

tune distance ratio, remove debugging in audio mixer
This commit is contained in:
birarda 2013-04-26 17:14:36 -07:00
commit 7ddf33b9c3
2 changed files with 4 additions and 7 deletions

View file

@ -52,11 +52,10 @@ const float BUFFER_SEND_INTERVAL_USECS = (BUFFER_LENGTH_SAMPLES_PER_CHANNEL / SA
const long MAX_SAMPLE_VALUE = std::numeric_limits<int16_t>::max(); const long MAX_SAMPLE_VALUE = std::numeric_limits<int16_t>::max();
const long MIN_SAMPLE_VALUE = std::numeric_limits<int16_t>::min(); const long MIN_SAMPLE_VALUE = std::numeric_limits<int16_t>::min();
const float DISTANCE_RATIO = 3.0/4.2; const float DISTANCE_RATIO = 3.0f / 0.3f;
const float PHASE_AMPLITUDE_RATIO_AT_90 = 0.5; const float PHASE_AMPLITUDE_RATIO_AT_90 = 0.5;
const int PHASE_DELAY_AT_90 = 20; const int PHASE_DELAY_AT_90 = 20;
const int AGENT_LOOPBACK_MODIFIER = 307; const int AGENT_LOOPBACK_MODIFIER = 307;
const int LOOPBACK_SANITY_CHECK = 0; const int LOOPBACK_SANITY_CHECK = 0;
@ -127,7 +126,7 @@ void *sendBuffer(void *args)
for (AgentList::iterator otherAgent = agentList->begin(); otherAgent != agentList->end(); otherAgent++) { for (AgentList::iterator otherAgent = agentList->begin(); otherAgent != agentList->end(); otherAgent++) {
if (otherAgent != agent || ( otherAgent == agent && agentWantsLoopback)) { if (otherAgent != agent || (otherAgent == agent && agentWantsLoopback)) {
AudioRingBuffer* otherAgentBuffer = (AudioRingBuffer*) otherAgent->getLinkedData(); AudioRingBuffer* otherAgentBuffer = (AudioRingBuffer*) otherAgent->getLinkedData();
float *agentPosition = agentRingBuffer->getPosition(); float *agentPosition = agentRingBuffer->getPosition();

View file

@ -151,10 +151,8 @@ int audioCallback (const void *inputBuffer,
unsigned char *currentPacketPtr = dataPacket + 1; unsigned char *currentPacketPtr = dataPacket + 1;
// memcpy the three float positions // memcpy the three float positions
for (int p = 0; p < 3; p++) { memcpy(currentPacketPtr, &data->linkedAvatar->getHeadPosition(), sizeof(float) * 3);
memcpy(currentPacketPtr, &data->linkedAvatar->getPosition()[p], sizeof(float)); currentPacketPtr += (sizeof(float) * 3);
currentPacketPtr += sizeof(float);
}
// tell the mixer not to add additional attenuation to our source // tell the mixer not to add additional attenuation to our source
*(currentPacketPtr++) = 255; *(currentPacketPtr++) = 255;