mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:38:29 +02:00
add packet headers and agent types for audio clarity
This commit is contained in:
parent
26c34bb86c
commit
ce34a8f3e0
4 changed files with 10 additions and 4 deletions
|
@ -268,9 +268,12 @@ int main(int argc, const char* argv[]) {
|
||||||
|
|
||||||
// pull any new audio data from agents off of the network stack
|
// pull any new audio data from agents off of the network stack
|
||||||
while (agentList->getAgentSocket().receive(agentAddress, packetData, &receivedBytes)) {
|
while (agentList->getAgentSocket().receive(agentAddress, packetData, &receivedBytes)) {
|
||||||
if (packetData[0] == PACKET_HEADER_INJECT_AUDIO) {
|
if (packetData[0] == PACKET_HEADER_INJECT_AUDIO || packetData[0] == PACKET_HEADER_MICROPHONE_AUDIO) {
|
||||||
|
char agentType = (packetData[0] == PACKET_HEADER_MICROPHONE_AUDIO)
|
||||||
|
? AGENT_TYPE_AVATAR
|
||||||
|
: AGENT_TYPE_AUDIO_INJECTOR;
|
||||||
|
|
||||||
if (agentList->addOrUpdateAgent(agentAddress, agentAddress, packetData[0], agentList->getLastAgentID())) {
|
if (agentList->addOrUpdateAgent(agentAddress, agentAddress, agentType, agentList->getLastAgentID())) {
|
||||||
agentList->increaseAgentID();
|
agentList->increaseAgentID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ int audioCallback (const void* inputBuffer,
|
||||||
// + 12 for 3 floats for position + float for bearing + 1 attenuation byte
|
// + 12 for 3 floats for position + float for bearing + 1 attenuation byte
|
||||||
unsigned char dataPacket[BUFFER_LENGTH_BYTES + leadingBytes];
|
unsigned char dataPacket[BUFFER_LENGTH_BYTES + leadingBytes];
|
||||||
|
|
||||||
dataPacket[0] = PACKET_HEADER_INJECT_AUDIO;
|
dataPacket[0] = PACKET_HEADER_MICROPHONE_AUDIO;
|
||||||
unsigned char *currentPacketPtr = dataPacket + 1;
|
unsigned char *currentPacketPtr = dataPacket + 1;
|
||||||
|
|
||||||
// memcpy the three float positions
|
// memcpy the three float positions
|
||||||
|
|
|
@ -20,8 +20,9 @@
|
||||||
// Agent Type Codes
|
// Agent Type Codes
|
||||||
const char AGENT_TYPE_DOMAIN = 'D';
|
const char AGENT_TYPE_DOMAIN = 'D';
|
||||||
const char AGENT_TYPE_VOXEL = 'V';
|
const char AGENT_TYPE_VOXEL = 'V';
|
||||||
const char AGENT_TYPE_AVATAR = 'I'; // could also be injector???
|
const char AGENT_TYPE_AVATAR = 'I';
|
||||||
const char AGENT_TYPE_AUDIO_MIXER = 'M';
|
const char AGENT_TYPE_AUDIO_MIXER = 'M';
|
||||||
const char AGENT_TYPE_AVATAR_MIXER = 'W';
|
const char AGENT_TYPE_AVATAR_MIXER = 'W';
|
||||||
|
const char AGENT_TYPE_AUDIO_INJECTOR = 'A';
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,6 +20,8 @@ const PACKET_HEADER PACKET_HEADER_PING_REPLY = 'R';
|
||||||
const PACKET_HEADER PACKET_HEADER_HEAD_DATA = 'H';
|
const PACKET_HEADER PACKET_HEADER_HEAD_DATA = 'H';
|
||||||
const PACKET_HEADER PACKET_HEADER_Z_COMMAND = 'Z';
|
const PACKET_HEADER PACKET_HEADER_Z_COMMAND = 'Z';
|
||||||
const PACKET_HEADER PACKET_HEADER_INJECT_AUDIO = 'I';
|
const PACKET_HEADER PACKET_HEADER_INJECT_AUDIO = 'I';
|
||||||
|
const PACKET_HEADER PACKET_HEADER_MIXED_AUDIO = 'A';
|
||||||
|
const PACKET_HEADER PACKET_HEADER_MICROPHONE_AUDIO = 'M';
|
||||||
const PACKET_HEADER PACKET_HEADER_SET_VOXEL = 'S';
|
const PACKET_HEADER PACKET_HEADER_SET_VOXEL = 'S';
|
||||||
const PACKET_HEADER PACKET_HEADER_SET_VOXEL_DESTRUCTIVE = 'O';
|
const PACKET_HEADER PACKET_HEADER_SET_VOXEL_DESTRUCTIVE = 'O';
|
||||||
const PACKET_HEADER PACKET_HEADER_ERASE_VOXEL = 'E';
|
const PACKET_HEADER PACKET_HEADER_ERASE_VOXEL = 'E';
|
||||||
|
|
Loading…
Reference in a new issue