fix: apply member volume in WebRTC playback

This commit is contained in:
illusia committed 2026-09-04 19:31:50 +08:00
1 parent 21041346e3
commit c38239ec35
5 files changed
+55 -6

No files matched your search

+4
View File
@@ -449,6 +449,7 @@ export class VoiceBridge {
tsClient.on("clientLeave", (info) => {
const wasKnown = entry!.members.has(info.id);
const leavingMember = entry!.members.get(info.id);
entry!.webrtc?.setMemberVolume(info.id, 1);
directory.applyClientLeave(info.id);
refreshDirectory();
if (tsReady && initialStateSent && wasKnown) {
@@ -922,6 +923,9 @@ async function handleCommand(
entry.webrtc?.setMicrophoneMuted(command.payload.muted as boolean);
} else if (command.type === "setAccompanimentActive") {
entry.webrtc?.setAccompanimentActive(command.payload.active as boolean);
} else if (command.type === "setMemberVolume") {
const clientId = command.payload.clientId as number;
if (entry.members.has(clientId)) entry.webrtc?.setMemberVolume(clientId, command.payload.volume as number);
}
if (command.requestId) sendJson({ type: "commandCompleted", requestId: command.requestId });
} catch (error: unknown) {