Play sound-pack notifications for client actions
Adds TeamSpeak-format sound packs: a folder of waves plus a settings.ini
mapping actions to play()/say() entries, with ${clientType} and friends
resolved per event. Packs are found in the client's own sound folder, an
installed TS3 client and a folder of the user's choosing, so the official
packs work unchanged.
Each action can be switched off or marked important; important actions are
the only ones still played while the speakers are muted, as in TS3. The new
Notifications options page lists them by category, greys out what the active
pack has no sound for, and previews on double-click.
Sounds are decoded, resampled and mixed onto a single playback line that is
only open while something plays, so overlapping events never fight over the
device.
Fires the events from the protocol layer, following TeamSpeak's own
distinctions: reason ids separate switched/moved/kicked/banned/timed out,
and visibility decides appears/disappears/stays.
Also fixes a ts3j trap in the process: a field an event never carried reads
back as an empty string, so the existing "e.get(x) != null" checks were
always true. That made a partial clientupdate (someone muting) announce a
stopped recording, and it let a nickname-only update reset another client's
mute/away flags and talk power, or a channel edit blank the channel name.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -80,6 +80,19 @@ frontend supplies its own UI and audio backend while reusing `core` unchanged.
|
||||
- **Status bar** shows the server name, user count and live ping.
|
||||
- Change your nickname, mute/deafen from the toolbar.
|
||||
|
||||
### Notification sounds
|
||||
- **Sound packs** in TeamSpeak's own format: a folder of waves plus a `settings.ini`
|
||||
mapping actions (`CONNECTION_CONNECTED`, `CLIENT_MOVED_TO_CURRENT_CHANNEL_STAYS`, …)
|
||||
to `play("file.wav")` entries, with `${clientType}`/`${channelname}`/… placeholders
|
||||
resolved per event. Packs are picked up from `~/.ts3jclient/sound`, an installed
|
||||
TeamSpeak 3 client (`$TS3_CLIENT_DIR` or the usual install paths) and a folder of
|
||||
your choosing, so the official packs work unchanged.
|
||||
- **Per-action configuration** (Options → Notifications): switch any action's sound
|
||||
off, and mark actions as **important** (shown in bold, as in TS3) — important
|
||||
actions are the only ones still played while the speakers are muted.
|
||||
- Sounds are mixed onto one playback line, so overlapping events never fight over
|
||||
the device; pack volume is separate from the voice volume.
|
||||
|
||||
## Requirements
|
||||
- Java 26+ (developed/tested on Temurin 26)
|
||||
- The native Opus library on the system:
|
||||
@@ -120,6 +133,13 @@ core/ com.ts3client
|
||||
│ ├── VoiceOutput voice-packet playback sink
|
||||
│ ├── OpusParameters live-tunable encoder settings
|
||||
│ └── SpeechDetector feature-based speech-probability VAD (Automatic/Hybrid)
|
||||
├── sound
|
||||
│ ├── SoundEvent catalogue of actions (TeamSpeak's own event ids)
|
||||
│ ├── SoundPack a pack folder + its settings.ini mapping
|
||||
│ ├── SoundPacks discovery of installed packs
|
||||
│ ├── NotificationSettings per-action enabled / important flags
|
||||
│ ├── SoundNotifier decides what is heard (pack + config + mute state)
|
||||
│ └── SoundPlayer platform hook for rendering a sound
|
||||
└── net
|
||||
├── TeamspeakConnection ties socket + audio backend + model, translates events
|
||||
├── ServerModel thread-safe channel/client state
|
||||
@@ -132,6 +152,7 @@ desktop/ com.ts3client.audio.desktop
|
||||
├── AudioDevices device enumeration + line opening (48 kHz/16-bit)
|
||||
├── JavaSoundVoiceInput capture + VAD/PTT gating + Opus encode
|
||||
├── JavaSoundVoiceOutput per-client Opus decode + playback + mixing
|
||||
├── WavSoundPlayer sound-pack playback: decode, resample and mix on one line
|
||||
└── JavaSoundAudioBackend wires the above into the core AudioBackend
|
||||
|
||||
swing/ com.ts3client
|
||||
@@ -143,6 +164,7 @@ swing/ com.ts3client
|
||||
├── InfoPanel channel description / client group + details view
|
||||
├── ChatPanel chat log + input
|
||||
├── SettingsDialog audio + VAD options with live meter
|
||||
├── NotificationsPanel sound pack + per-action sound/important configuration
|
||||
├── ConnectDialog connect form
|
||||
├── BookmarksDialog manage saved servers
|
||||
├── IdentitiesDialog manage identities (new/import/export/improve)
|
||||
|
||||
Reference in New Issue
Block a user