mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 14:39:45 +02:00
local loopback test from mixer for sanity check
This commit is contained in:
parent
14e3160d50
commit
73f6d9311d
1 changed files with 14 additions and 2 deletions
|
@ -39,6 +39,8 @@ const int PHASE_DELAY_AT_90 = 20;
|
||||||
|
|
||||||
const int AGENT_LOOPBACK_MODIFIER = 307;
|
const int AGENT_LOOPBACK_MODIFIER = 307;
|
||||||
|
|
||||||
|
const int LOOPBACK_SANITY_CHECK = 1;
|
||||||
|
|
||||||
char DOMAIN_HOSTNAME[] = "highfidelity.below92.com";
|
char DOMAIN_HOSTNAME[] = "highfidelity.below92.com";
|
||||||
char DOMAIN_IP[100] = ""; // IP Address will be re-set by lookup on startup
|
char DOMAIN_IP[100] = ""; // IP Address will be re-set by lookup on startup
|
||||||
const int DOMAINSERVER_PORT = 40102;
|
const int DOMAINSERVER_PORT = 40102;
|
||||||
|
@ -299,14 +301,24 @@ int main(int argc, const char * argv[])
|
||||||
pthread_t sendBufferThread;
|
pthread_t sendBufferThread;
|
||||||
pthread_create(&sendBufferThread, NULL, sendBuffer, NULL);
|
pthread_create(&sendBufferThread, NULL, sendBuffer, NULL);
|
||||||
|
|
||||||
|
int16_t *loopbackAudioPacket;
|
||||||
|
if (LOOPBACK_SANITY_CHECK) {
|
||||||
|
loopbackAudioPacket = new int16_t[1024];
|
||||||
|
}
|
||||||
|
|
||||||
sockaddr *agentAddress = new sockaddr;
|
sockaddr *agentAddress = new sockaddr;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if(agentList.getAgentSocket().receive(agentAddress, packetData, &receivedBytes)) {
|
if(agentList.getAgentSocket().receive(agentAddress, packetData, &receivedBytes)) {
|
||||||
if (packetData[0] == 'I') {
|
if (packetData[0] == 'I') {
|
||||||
// add or update the existing interface agent
|
// add or update the existing interface agent
|
||||||
agentList.addOrUpdateAgent(agentAddress, agentAddress, packetData[0]);
|
if (!LOOPBACK_SANITY_CHECK) {
|
||||||
agentList.updateAgentWithData(agentAddress, (void *)packetData, receivedBytes);
|
agentList.addOrUpdateAgent(agentAddress, agentAddress, packetData[0]);
|
||||||
|
agentList.updateAgentWithData(agentAddress, (void *)packetData, receivedBytes);
|
||||||
|
} else {
|
||||||
|
memcpy(loopbackAudioPacket, packetData + 1 + (sizeof(float) * 4), 1024);
|
||||||
|
agentList.getAgentSocket().send(agentAddress, loopbackAudioPacket, 1024);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue