`WebRtcAudioSession` builds its `RTCPeerConnection`, attaches the outgoing
track and adds the audio transceiver before it creates the mixer encoder. When
that encoder cannot be created the constructor stops the track and throws, but
it never closed the peer it had already built.
The caller cannot cover for it. `handleWebRtcOffer` assigns the factory result
to a local that starts as `null`:
let peer: WebRtcAudioSession | null = null;
...
peer = this.createWebRtcSession({ ... });
so a throwing constructor leaves `peer` at `null`, and the catch block's
`if (entry.webrtc === peer) entry.webrtc = null;` and `await peer?.close()` are
both no-ops. The peer was created, never closed, and no handle to it survived
the unwind.
The impact today is bounded, and the defect is the broken invariant rather than
a measured leak: the throw lands before ICE gathering starts, before
`scheduleAudioTick()` and `activityTimer` are installed, and werift's
constructor binds no socket or timer of its own, so the unreachable instance is
reclaimed by garbage collection. But an exception during construction must not
strand a half-built resource, and any acquisition added above that point would
turn this into a real leak.
Close the peer before propagating the failure:
* `this.peer.close()` now runs before the throw, so the peer is released even
though the caller never receives the session;
* `createEncoder` becomes an injectable option on `WebRtcAudioSessionOptions`,
mirroring `VoiceBridgeDependencies.createEncoder` and `createWebRtcSession`.
Production still resolves to `new OpusEncoder(AUDIO_SAMPLE_RATE, 1)`, so
behaviour is unchanged; the seam exists so the failure branch is reachable
without a machine that happens to lack the native codec.
Covered by a regression test that injects a failing encoder and instruments
`RTCPeerConnection.prototype.close` to count the distinct peers closed during
construction. It reports 0 on the old code and 1 with the fix, in any
environment and with no dependency on native Opus.
WebSpeak
让 TeamSpeak 自然地进入浏览器。
A self-hosted browser voice client for TeamSpeak 3 and TeamSpeak 6.
简体中文文档 · English documentation · Deutsche Dokumentation · Русская документация · 日本語ドキュメント
项目简介 · Overview
| 逻辑 | 中文 | English |
|---|---|---|
| WHAT | WebSpeak 是一个可自行部署的 TeamSpeak 3 / TeamSpeak 6 网页客户端与语音网关。 | WebSpeak is a self-hosted browser client and voice gateway for TeamSpeak 3 and TeamSpeak 6. |
| WHY | 无需安装桌面客户端,用户打开网页即可加入频道;部署者仍然掌控目标服务器、访问策略和数据。 | Users can join a voice channel from a browser without installing a desktop client, while the operator keeps control of servers, access, and data. |
| HOW | 部署后在管理员控制台配置 TeamSpeak 目标和访问方式,浏览器负责交互与音频,WebSpeak 负责网关连接。 | Configure the TeamSpeak target and access policy in the administration console. The browser handles interaction and audio; WebSpeak provides the gateway connection. |
文档 · Documentation
- 简体中文
- English
- Deutsch
- Русский
- 日本語
- 皮肤开发指南 / Skin development guide
- 皮肤开发 Agent Skill / Skin Development Agent Skill
社区 · Community
友链项目 · Friend projects
NeteaseTSBot
面向 TeamSpeak 3/6 的多平台音乐点播机器人,支持网易云音乐、QQ 音乐和 Bilibili 音频播放,并提供 Web 控制台。
A multi-platform music bot for TeamSpeak 3/6 with Netease Cloud Music, QQ Music, and Bilibili playback, plus a web console.
Ein plattformübergreifender Musikbot für TeamSpeak 3/6 mit Netease Cloud Music, QQ Music und Bilibili sowie Webkonsole.
Contributors · 贡献者
感谢通过 PR 改进 WebSpeak 的贡献者。以下按 GitHub 的合并记录列出。
- LainHE — PR #2 改进浏览器端报错翻译;PR #8 修正缩放、浮动布局和首页脚注。
- TimmySheep — 已合并 PR #13、#15–#24,涉及 TS6 既有屏幕共享发现、屏幕比例、移动端语音/常亮/皮肤菜单、身份频道选项、PWA/主题、聊天历史、成员音频状态和麦克风权限等改进。
- yichen11818 — PR #25 支持通过 TeamSpeak 注册昵称连接,并在设置、收藏和邀请中保留昵称目标。
许可证 · License · Lizenz · Лицензия · ライセンス
WebSpeak 使用 GNU Affero General Public License v3.0 only 发布。你可以使用、研究、修改和再分发本项目;如果修改后的版本通过网络向用户提供服务,需要按照 AGPL-3.0 向这些用户提供对应源代码。
WebSpeak is released under the GNU Affero General Public License v3.0 only. If a modified version is offered to users over a network, its corresponding source code must be offered under AGPL-3.0.
WebSpeak wird unter der GNU Affero General Public License v3.0 only veröffentlicht. Bei Bereitstellung einer veränderten Version über ein Netzwerk muss der entsprechende Quellcode unter AGPL-3.0 angeboten werden.
WebSpeak распространяется по лицензии GNU Affero General Public License v3.0 only. Если изменённая версия предоставляется пользователям через сеть, соответствующий исходный код должен быть доступен этим пользователям на условиях AGPL-3.0.
WebSpeak は GNU Affero General Public License v3.0 only の下で公開されています。変更版をネットワーク経由でユーザーに提供する場合は、対応するソースコードを AGPL-3.0 に従ってユーザーに提供する必要があります。