Move the voice pipelines into core

Capture processing, the jitter buffer and decoding were desktop classes,
so any other platform would have had to copy them. They now live in core
and reach the platform only through two interfaces:

- AudioIo lists devices and opens capture/playback lines; the desktop's
  AudioDevices implements it over PipeWire and Java Sound.
- OpusCodec creates encoders and decoders; the desktop binds libopus
  through the FFM API as before.

DesktopVoiceInput becomes CaptureVoiceInput unchanged in behaviour.
DesktopVoiceOutput splits into VoiceStream, one speaker's jitter buffer
and decoder, paced by whoever pulls it, and StreamingVoiceOutput around
it. Speakers reach the device either on a line each (the desktop, so
each shows up in the PipeWire mixer) or mixed onto one shared line, as
mobile audio APIs want.

The settings dialog's device lists and microphone test now go through
the AudioBackend instead of desktop classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 08:01:28 +00:00
co-authored by Claude Opus 5.5
parent 3c389de36b
commit 7396c4ca40
36 changed files with 1290 additions and 531 deletions
@@ -1,6 +1,7 @@
package com.ts3client.ui;
import com.formdev.flatlaf.util.UIScale;
import com.ts3client.audio.AudioBackend;
import com.ts3client.audio.InputLevel;
import com.ts3client.audio.OpusParameters;
import com.ts3client.audio.VoiceInput;
@@ -42,7 +43,7 @@ final class VoiceActivationPanel extends FormPanel {
private final HotkeyService hotkeys;
private final HotkeysPanel hotkeysPanel;
private final Supplier<Settings> audioSnapshot;
private final MicrophoneTest micTest = new MicrophoneTest(this::onTestLevel, this::onTestTalking);
private final MicrophoneTest micTest;
private final JRadioButton vadRadio;
private final JRadioButton pttRadio;
@@ -62,10 +63,11 @@ final class VoiceActivationPanel extends FormPanel {
private final JCheckBox fecCheck;
private final JCheckBox musicCheck;
VoiceActivationPanel(Settings settings, VoiceInput liveMic, HotkeyService hotkeys,
VoiceActivationPanel(Settings settings, AudioBackend audio, VoiceInput liveMic, HotkeyService hotkeys,
HotkeysPanel hotkeysPanel, Supplier<Settings> audioSnapshot) {
this.settings = settings;
this.liveMic = liveMic;
this.micTest = new MicrophoneTest(audio, this::onTestLevel, this::onTestTalking);
this.hotkeys = hotkeys;
this.hotkeysPanel = hotkeysPanel;
this.audioSnapshot = audioSnapshot;