Send serverflag0 with new packets as a test of sorts
This commit is contained in:
+14
@@ -507,6 +507,8 @@ public class LocalTeamspeakClientSocket
|
|||||||
|
|
||||||
private class MicrophoneTask implements Runnable {
|
private class MicrophoneTask implements Runnable {
|
||||||
private boolean wasSendingAudio = false;
|
private boolean wasSendingAudio = false;
|
||||||
|
private byte sessionId = 1;
|
||||||
|
private int flaggedPackets = 5;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -525,12 +527,17 @@ public class LocalTeamspeakClientSocket
|
|||||||
} else if (microphone.isReady()) {
|
} else if (microphone.isReady()) {
|
||||||
PacketBody0Voice voice = new PacketBody0Voice(getRole().getOut());
|
PacketBody0Voice voice = new PacketBody0Voice(getRole().getOut());
|
||||||
|
|
||||||
|
if (flaggedPackets > 0) {
|
||||||
|
voice.setServerFlag0(sessionId);
|
||||||
|
}
|
||||||
|
|
||||||
voice.setCodecType(microphone.getCodec());
|
voice.setCodecType(microphone.getCodec());
|
||||||
voice.setCodecData(microphone.provide());
|
voice.setCodecData(microphone.provide());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
writePacket(voice);
|
writePacket(voice);
|
||||||
|
|
||||||
|
flaggedPackets --;
|
||||||
wasSendingAudio = true;
|
wasSendingAudio = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// All we are really concerned about here is a disconnection event, in which case the loop
|
// All we are really concerned about here is a disconnection event, in which case the loop
|
||||||
@@ -546,6 +553,13 @@ public class LocalTeamspeakClientSocket
|
|||||||
try {
|
try {
|
||||||
writePacket(voice);
|
writePacket(voice);
|
||||||
|
|
||||||
|
// reset decoder flag
|
||||||
|
flaggedPackets = 5;
|
||||||
|
sessionId ++;
|
||||||
|
|
||||||
|
if (sessionId >= 8)
|
||||||
|
sessionId = 1;
|
||||||
|
|
||||||
wasSendingAudio = false;
|
wasSendingAudio = false;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// All we are really concerned about here is a disconnection event, in which case the loop
|
// All we are really concerned about here is a disconnection event, in which case the loop
|
||||||
|
|||||||
Reference in New Issue
Block a user