mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix: keep accompaniment audible while microphone is muted
This commit is contained in:
1 parent
051cb402e5
commit
777c779d79
8 files changed
+166
-16
No files matched your search
@@ -9,7 +9,7 @@ import { teamSpeakServerErrorCode } from "../errors.js";
|
||||
|
||||
/** Only the session capabilities used by control commands cross this boundary. */
|
||||
export interface VoiceCommandContext extends AudioStatsSource {
|
||||
tsClient: Pick<TSClient, "execCommandWithResponse" | "switchChannel" | "getClientId" | "getChannelId" | "moveClient" | "sendTextMessage" | "poke" | "setAway" | "setInputMuted">;
|
||||
tsClient: Pick<TSClient, "execCommandWithResponse" | "switchChannel" | "getClientId" | "getChannelId" | "moveClient" | "sendTextMessage" | "poke" | "setAway" | "setInputMuted" | "setAccompanimentActive">;
|
||||
channelTree: ChannelInfo[];
|
||||
members: ReadonlyMap<number, { uid?: string }>;
|
||||
whisperTargetIds: Set<number>;
|
||||
@@ -154,7 +154,11 @@ export async function handleCommand(
|
||||
await entry.tsClient.setInputMuted(muted);
|
||||
entry.webrtc?.setMicrophoneMuted(muted);
|
||||
} else if (command.type === "setAccompanimentActive") {
|
||||
entry.webrtc?.setAccompanimentActive(command.payload.active);
|
||||
const peer = entry.webrtc;
|
||||
if (peer) {
|
||||
await entry.tsClient.setAccompanimentActive(command.payload.active);
|
||||
if (entry.webrtc === peer) peer.setAccompanimentActive(command.payload.active);
|
||||
}
|
||||
} else if (command.type === "setMemberVolume") {
|
||||
const clientId = command.payload.clientId;
|
||||
entry.webrtc?.setMemberVolume(clientId, command.payload.volume);
|
||||
|
||||
Reference in new issue
Block a user