fix: use libopus wasm 0.1.0 for discord voice

This commit is contained in:
Peter Steinberger
2026-05-26 16:13:14 +01:00
parent 23786d4bb1
commit cdde8b89aa
6 changed files with 21 additions and 11 deletions

View File

@@ -11,7 +11,7 @@
"@discordjs/voice": "0.19.2",
"discord-api-types": "0.38.48",
"https-proxy-agent": "9.0.0",
"libopus-wasm": "0.0.1",
"libopus-wasm": "0.1.0",
"prism-media": "1.3.5",
"typebox": "1.1.38",
"undici": "8.3.0",
@@ -424,9 +424,9 @@
}
},
"node_modules/libopus-wasm": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/libopus-wasm/-/libopus-wasm-0.0.1.tgz",
"integrity": "sha512-w//dxORfJfLl4quaA5nEA0xZlbbtS/Gba+NrZyCDPmAQh2THX4KI6aI600f+jpxf6v3p9ApGCx0/DCCe4Xftug==",
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/libopus-wasm/-/libopus-wasm-0.1.0.tgz",
"integrity": "sha512-/aurGcAVgy0GcBEUzFaX9pm9qv7zYcy8W5hBXFiK+cyqOXAX4lOS6rlFogkY9CcSIajhjnuXyixsbmziSHCDMQ==",
"license": "MIT",
"engines": {
"node": ">=20"

View File

@@ -11,7 +11,7 @@
"@discordjs/voice": "0.19.2",
"discord-api-types": "0.38.48",
"https-proxy-agent": "9.0.0",
"libopus-wasm": "0.0.1",
"libopus-wasm": "0.1.0",
"prism-media": "1.3.5",
"typebox": "1.1.38",
"undici": "8.3.0",

View File

@@ -29,6 +29,15 @@ describe("voice receive recovery", () => {
});
});
it("treats premature stream close as an expected receive end", () => {
expect(analyzeVoiceReceiveError(new Error("Premature close"))).toEqual({
message: "Premature close",
isAbortLike: true,
shouldAttemptPassthrough: false,
countsAsDecryptFailure: false,
});
});
it("gates recovery after repeated decrypt failures in the same window", () => {
const state = createVoiceReceiveRecoveryState();

View File

@@ -74,6 +74,7 @@ function isAbortLikeReceiveError(err: unknown): boolean {
: "";
return (
name === "AbortError" ||
message === "Premature close" ||
message.includes("The operation was aborted") ||
message.includes("aborted")
);

10
pnpm-lock.yaml generated
View File

@@ -616,8 +616,8 @@ importers:
specifier: 9.0.0
version: 9.0.0
libopus-wasm:
specifier: 0.0.1
version: 0.0.1
specifier: 0.1.0
version: 0.1.0
prism-media:
specifier: 1.3.5
version: 1.3.5
@@ -5479,8 +5479,8 @@ packages:
resolution: {integrity: sha512-s6WVJyEZrbm6jhBpiKHsGHyePMrVQKJ85wZCFCr9W4QHv6WTjWIrdvTmO9hDEA3bNK0xkrE2DqrHsXMLWuZpQg==}
engines: {node: '>=22.0.0'}
libopus-wasm@0.0.1:
resolution: {integrity: sha512-w//dxORfJfLl4quaA5nEA0xZlbbtS/Gba+NrZyCDPmAQh2THX4KI6aI600f+jpxf6v3p9ApGCx0/DCCe4Xftug==}
libopus-wasm@0.1.0:
resolution: {integrity: sha512-/aurGcAVgy0GcBEUzFaX9pm9qv7zYcy8W5hBXFiK+cyqOXAX4lOS6rlFogkY9CcSIajhjnuXyixsbmziSHCDMQ==}
engines: {node: '>=20'}
libsignal@6.0.0:
@@ -11294,7 +11294,7 @@ snapshots:
kysely@0.29.2: {}
libopus-wasm@0.0.1: {}
libopus-wasm@0.1.0: {}
libsignal@6.0.0:
dependencies:

View File

@@ -16,7 +16,7 @@ minimumReleaseAgeExclude:
- "basic-ftp"
- "baileys@7.0.0-rc13"
- "hono"
- "libopus-wasm@0.0.1"
- "libopus-wasm@0.1.0"
- "libsignal@6.0.0"
- "openclaw"
- "protobufjs"