Put the voice source behind a ServerLink

The session no longer spawns the TeamSpeak connection itself. link.rs adds
ServerLink (spawn(options, ctx, cmds, events)) with LinkCmd and LinkEvent,
VoiceCmd and VoiceEvent moved and renamed, plus ConnectOptions (VoiceOptions
stays as its name for the app), LinkCtx and Remote. TsLink (ts_link.rs) is
the TeamSpeak implementation and the engine's default; Engine::start_with_link
takes another.

The stream task moves inside the connection: voice.rs spawns it when the
server has streams, feeds it the server's notifications and the clients'
channels, and sends its requests. The session reaches it only through
LinkCmd::Stream(StreamCmd) and hears of our own stream (OwnStream) and the
audio of watched streams (StreamAudio) as link events, so the link holds no
handle on the audio thread. stream.rs keeps its tests, adapted to the split
of StreamInput into StreamCmd and the link-private input.

tests/link_fake.rs drives the session with an in-memory link: connect,
presence, commands, a message sent and echoed, a message that comes twice,
history, and a replaced connection, without a TeamSpeak crate. The
architecture doc describes ServerLink and the planned move of TsLink to
VoelinGateWay and the QUIC link of VoelinProtocol.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-14 15:54:08 +03:00
1 parent da372dfe10
commit 6c1898bf5a
10 files changed
+1492 -563

No files matched your search

+3 -1
View File
@@ -30,7 +30,9 @@ TeamSpeak connection that is `out_audio` and `voice_packet` in
`voelin-core/src/voice.rs`, the only place that builds TeamSpeak audio packets
from `EncodedVoice` or reads them into `VoicePacket`s (codecs other than Opus
are dropped there, as the jitter buffer never played them). The audio thread,
the session and the mixer see only the types above.
the session and the mixer see only the types above, and so does the link's
seam: `LinkCmd::Audio` carries an `EncodedVoice` out and `LinkEvent::Audio` a
`VoicePacket` in (`voelin-core/src/link.rs`).
## Echo cancellation, noise suppression, gain control