mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix(audio): avoid duplicate WebRTC playback
This commit is contained in:
1 parent
8abd2d6228
commit
46b190a913
2 files changed
+11
-1
No files matched your search
@@ -1096,6 +1096,10 @@ export function useVoiceWebSocket() {
|
||||
}
|
||||
|
||||
function handleAudioFrame(data: Uint8Array): void {
|
||||
// WebRTC carries the realtime downlink after negotiation. Ignore any
|
||||
// in-flight fallback WebSocket packets so a transport switch cannot
|
||||
// produce duplicate or delayed playback.
|
||||
if (webrtcActive.value) return;
|
||||
if (data.length < 4) return;
|
||||
const clientId = (data[1] << 8) | data[2];
|
||||
if (clientId === state.tsClientId) return;
|
||||
|
||||
Reference in new issue
Block a user