Bundle libopus natives for a self-contained JAR
Vendor libopus binaries under the desktop module's resources at JNA's
platform resource paths (linux-x86-64/libopus.so, win32-x86-64/opus.dll,
etc.), sourced from the checksum-verified club.minnced:opus-java-natives
1.1.1 artifact with the Windows lib renamed to JNA's mapped name.
Native.load("opus") still prefers a system libopus but now falls back to
the bundled copy, so the shaded uber-JAR runs with no external Opus
install on Linux (x86-64/x86/aarch64/arm), Windows (x86-64/x86) and
Intel macOS.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -9,9 +9,12 @@ import java.nio.IntBuffer;
|
||||
/**
|
||||
* Minimal JNA binding to the native Opus codec library (libopus).
|
||||
*
|
||||
* <p>We bind directly to the system-installed {@code libopus.so}/{@code opus.dll}
|
||||
* rather than relying on a bundled wrapper. Opus always operates internally at
|
||||
* 48 kHz which matches what the TeamSpeak 3 protocol uses on the wire.
|
||||
* <p>{@link Native#load} first tries a system-installed {@code libopus.so}/
|
||||
* {@code opus.dll}; failing that, JNA extracts and loads the copy we bundle on
|
||||
* the classpath under its platform resource path (e.g. {@code linux-x86-64/libopus.so},
|
||||
* {@code win32-x86-64/opus.dll}), so the client runs from the single JAR with no
|
||||
* external Opus install. Opus always operates internally at 48 kHz which
|
||||
* matches what the TeamSpeak 3 protocol uses on the wire.
|
||||
*/
|
||||
public interface Opus extends Library {
|
||||
|
||||
|
||||
Binary file not shown.
BIN
ts3-client/desktop/src/main/resources/darwin/libopus.dylib
Normal file
BIN
ts3-client/desktop/src/main/resources/darwin/libopus.dylib
Normal file
Binary file not shown.
BIN
ts3-client/desktop/src/main/resources/linux-aarch64/libopus.so
Normal file
BIN
ts3-client/desktop/src/main/resources/linux-aarch64/libopus.so
Normal file
Binary file not shown.
BIN
ts3-client/desktop/src/main/resources/linux-arm/libopus.so
Normal file
BIN
ts3-client/desktop/src/main/resources/linux-arm/libopus.so
Normal file
Binary file not shown.
BIN
ts3-client/desktop/src/main/resources/linux-x86-64/libopus.so
Normal file
BIN
ts3-client/desktop/src/main/resources/linux-x86-64/libopus.so
Normal file
Binary file not shown.
BIN
ts3-client/desktop/src/main/resources/linux-x86/libopus.so
Normal file
BIN
ts3-client/desktop/src/main/resources/linux-x86/libopus.so
Normal file
Binary file not shown.
BIN
ts3-client/desktop/src/main/resources/win32-x86-64/opus.dll
Normal file
BIN
ts3-client/desktop/src/main/resources/win32-x86-64/opus.dll
Normal file
Binary file not shown.
BIN
ts3-client/desktop/src/main/resources/win32-x86/opus.dll
Normal file
BIN
ts3-client/desktop/src/main/resources/win32-x86/opus.dll
Normal file
Binary file not shown.
Reference in New Issue
Block a user