Ship the Android sound packs as Opus

The build encodes TeamSpeak's packs to Ogg Opus at 64 kbps before bundling
them, which takes the sounds from 21.3 MB to 2.0 MB, in the APK and again
once unpacked on the phone. The encoding runs the desktop code's libopus
on the build machine, through a build-only :desktop module compiled from
the same sources as the Maven one.

Both clients play Opus sounds: the sound player (now PackSoundPlayer, as it
no longer plays only wave files) decodes Ogg Opus with the platform's
libopus, and a pack's play("x.wav") finds x.opus, so converted packs keep
their scripts. SoundPackConverter turns any pack folder into Opus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 17:12:50 +00:00
co-authored by Claude Opus 5.5
parent 02ff63341e
commit 4b50f37735
12 changed files with 456 additions and 32 deletions
@@ -0,0 +1,26 @@
package com.ts3client.audio.desktop;
import com.ts3client.sound.SoundPackConverter;
import java.io.File;
import java.io.IOException;
/**
* Converts a folder of sound packs to Opus with the bundled libopus — the Android build
* ships TeamSpeak's packs this way.
*
* <p>Usage: {@code EncodeSoundPacks <source folder> <target folder>}
*/
public final class EncodeSoundPacks {
private EncodeSoundPacks() {
}
public static void main(String[] args) throws IOException {
if (args.length != 2) {
System.err.println("Usage: EncodeSoundPacks <source folder> <target folder>");
System.exit(2);
}
SoundPackConverter.convert(new File(args[0]), new File(args[1]), new NativeOpusCodec());
}
}