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).
|
* Minimal JNA binding to the native Opus codec library (libopus).
|
||||||
*
|
*
|
||||||
* <p>We bind directly to the system-installed {@code libopus.so}/{@code opus.dll}
|
* <p>{@link Native#load} first tries a system-installed {@code libopus.so}/
|
||||||
* rather than relying on a bundled wrapper. Opus always operates internally at
|
* {@code opus.dll}; failing that, JNA extracts and loads the copy we bundle on
|
||||||
* 48 kHz which matches what the TeamSpeak 3 protocol uses on the wire.
|
* 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 {
|
public interface Opus extends Library {
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user