Add whisper (targeted voice to channels/clients)

Connector: a new "whisper <channelIds>;<clientIds>" stdin command sets
persistent whisper targets; outgoing audio then goes out as
AudioData::C2SWhisper instead of the normal C2S broadcast until
"unwhisper" clears it. Gateway relays a setWhisperTargets message the
same way.

Frontend: a toolbar toggle lists channels as checkboxes, and the
client context menu gets an "add/remove as whisper target" entry;
selecting any target switches all subsequent outgoing voice to
whisper mode.

Verified against the real test server: setting a channel target and
sending a frame produced no connector error, and clearing targets
resumed normal voice cleanly.
This commit is contained in:
Moepchi committed 2026-08-02 14:41:54 +02:00
1 parent 7217bc146a
commit 5858631e6d
5 files changed
+184 -7

No files matched your search

+4
View File
@@ -114,6 +114,10 @@ wss.on("connection", (socket: WebSocket) => {
await connection?.setOutputMuted(msg.muted);
break;
}
case "setWhisperTargets": {
await connection?.setWhisperTargets(msg.channelIds ?? [], msg.clientIds ?? []);
break;
}
case "disconnect": {
await connection?.disconnect(msg.message ?? "");
break;
+10
View File
@@ -268,6 +268,16 @@ export class Ts3Connection {
this.child?.stdin.write(`muteoutput ${muted ? "1" : "0"}\n`);
}
/** Empty channelIds/clientIds clears whisper mode, returning outgoing
* voice to the normal current-channel broadcast. */
async setWhisperTargets(channelIds: number[], clientIds: number[]): Promise<void> {
if (channelIds.length === 0 && clientIds.length === 0) {
this.child?.stdin.write("unwhisper\n");
} else {
this.child?.stdin.write(`whisper ${channelIds.join(",")};${clientIds.join(",")}\n`);
}
}
async disconnect(message = ""): Promise<void> {
if (this.child && !this.child.killed) {
const sanitized = message.replace(/[\r\n]+/g, " ").trim();