mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix: synchronize microphone mute state
This commit is contained in:
1 parent
fae21ec086
commit
bcf212738b
6 files changed
+35
-8
No files matched your search
@@ -546,6 +546,12 @@ export class VoiceBridge {
|
||||
}
|
||||
});
|
||||
|
||||
tsClient.on("clientUpdated", (info) => {
|
||||
directory.applyClientUpdated(info);
|
||||
refreshDirectory();
|
||||
if (tsReady && initialStateSent) sendJson({ type: "channelList", channels: entry!.channelTree });
|
||||
});
|
||||
|
||||
tsClient.on("voiceData", (data: TSVoiceData) => {
|
||||
const receivedAt = Date.now();
|
||||
if (entry!.audio.tsReceiveLastAt !== null) entry!.audio.tsReceiveMaxGapMs = Math.max(entry!.audio.tsReceiveMaxGapMs, receivedAt - entry!.audio.tsReceiveLastAt);
|
||||
@@ -1086,7 +1092,9 @@ async function handleCommand(
|
||||
entry.whisperActive = active;
|
||||
sendJson({ type: "whisperTargets", targetIds: [...entry.whisperTargetIds], active: entry.whisperActive });
|
||||
} else if (command.type === "setMicrophoneMuted") {
|
||||
entry.webrtc?.setMicrophoneMuted(command.payload.muted as boolean);
|
||||
const muted = command.payload.muted as boolean;
|
||||
await entry.tsClient.setInputMuted(muted);
|
||||
entry.webrtc?.setMicrophoneMuted(muted);
|
||||
} else if (command.type === "setAccompanimentActive") {
|
||||
entry.webrtc?.setAccompanimentActive(command.payload.active as boolean);
|
||||
} else if (command.type === "setMemberVolume") {
|
||||
|
||||
Reference in new issue
Block a user