Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(baileys): install audio-decode so voice notes carry a waveform

Yudhi Armyndharis45515b078e55
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7ba07c751..1e6260c69 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
-### Added
+### Fixed
+
+- **Voice notes sent through the Baileys engine now carry a waveform.** Baileys draws the amplitude
+ bars from `audio-decode`, which it declares as an optional peer dependency and imports at send
+ time. It was never installed, so that import threw on every voice note, was swallowed by a
+ debug-level catch, and each one went out with a flat bar — a silent failure with no signal
+ anywhere above `debug`, on a send that otherwise succeeded.
+
+ Installing it is the upstream-supported path, at the major version Baileys itself asks for. That
+ detail matters: the newest release is a major ahead, installs cleanly and resolves fine, and would
+ quietly leave the declared peer range unmet. A spec now checks the dependency is declared,
+ resolvable, and on that major, since the failure it prevents is invisible at runtime.
+
+ whatsapp-web.js was never affected — it generates the waveform in the browser page.
+
- **Labels are reachable from an agent.** They had five REST endpoints and no tools at all, so an
agent could read and write contacts, groups, messages and webhooks but could not see a label, let
diff --git a/package-lock.json b/package-lock.json
index 6ea35df99..8b237c6bb 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "openwa",
- "version": "0.12.3",
+ "version": "0.13.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openwa",
- "version": "0.12.3",
+ "version": "0.13.0",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
@@ -29,6 +29,7 @@
"@whiskeysockets/baileys": "7.0.0-rc13",
"adm-zip": "^0.6.0",
"archiver": "^8.0.0",
+ "audio-decode": "^2.2.3",
"better-sqlite3": "^12.11.1",
"bullmq": "^5.81.2",
"class-transformer": "^0.5.1",
@@ -647,6 +648,7 @@
"integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@babel/code-frame": "^7.29.7",
"@babel/generator": "^7.29.7",
@@ -1152,6 +1154,7 @@
"resolved": "https://registry.npmjs.org/@bull-board/api/-/api-8.3.0.tgz",
"integrity": "sha512-5ti+DROXnlZeQYnOiapUc2t4JFWO2rCPMxzZZbG15e8Nn2sX4gU0x09WqLfDU19RjYWDnNa1FtJm1DdQEC6Z0Q==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"redis-info": "^3.1.0"
},
@@ -1200,6 +1203,7 @@
"resolved": "https://registry.npmjs.org/@bull-board/ui/-/ui-8.3.0.tgz",
"integrity": "sha512-ZKHvHEzLekyDqSQEECOJZ0gP2wcba0Jdm+0dl7SXu82qfp03HIxrvmsKZJzG9bLVSI3GitLgcIaYHWsjDjHFZQ==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"@bull-board/api": "8.3.0"
}
@@ -1237,6 +1241,7 @@
"resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz",
"integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"@keyv/serialize": "^1.1.1"
}
@@ -1351,6 +1356,12 @@
"tslib": "^2.4.0"
}
},
+ "node_modules/@eshaz/web-worker": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/@eshaz/web-worker/-/web-worker-1.2.2.tgz",
+ "integrity": "sha512-WxXiHFmD9u/owrzempiDlBB1ZYqiLnm9s6aPc8AlFQalq2tKmqdmMr9GXOupDgzXtqnBipj8Un0gkIm7Sjf8mw==",
+ "license": "Apache-2.0"
+ },
"node_modules/@eslint-community/eslint-utils": {
"version": "4.9.1",
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",
@@ -1679,7 +1690,6 @@
"resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",
"integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=18"
}
@@ -1696,7 +1706,6 @@
"os": [
"darwin"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -1719,7 +1728,6 @@
"os": [
"darwin"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -1739,7 +1747,6 @@
"os": [
"freebsd"
],
- "peer": true,
"dependencies": {
"@img/sharp-wasm32": "0.35.1"
},
@@ -1762,7 +1769,6 @@
"os": [
"darwin"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1779,7 +1785,6 @@
"os": [
"darwin"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1796,7 +1801,6 @@
"os": [
"linux"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1813,7 +1817,6 @@
"os": [
"linux"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1830,7 +1833,6 @@
"os": [
"linux"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1847,7 +1849,6 @@
"os": [
"linux"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1864,7 +1865,6 @@
"os": [
"linux"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1881,7 +1881,6 @@
"os": [
"linux"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1898,7 +1897,6 @@
"os": [
"linux"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1915,7 +1913,6 @@
"os": [
"linux"
],
- "peer": true,
"funding": {
"url": "https://opencollective.com/libvips"
}
@@ -1932,7 +1929,6 @@
"os": [
"linux"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -1955,7 +1951,6 @@
"os": [
"linux"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -1978,7 +1973,6 @@
"os": [
"linux"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -2001,7 +1995,6 @@
"os": [
"linux"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -2024,7 +2017,6 @@
"os": [
"linux"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -2047,7 +2039,6 @@
"os": [
"linux"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -2070,7 +2061,6 @@
"os": [
"linux"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -2093,7 +2083,6 @@
"os": [
"linux"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -2110,7 +2099,6 @@
"integrity": "sha512-PCQUoQdZyE8tp3HpbevuihfUmgSP4qWI0FGEPWoeXqaS+cUrFfemabHQiebUmUmlUhCuNnQMxGrQ+CPqK4hnxg==",
"license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
"optional": true,
- "peer": true,
"dependencies": {
"@emnapi/runtime": "^1.11.0"
},
@@ -2130,7 +2118,6 @@
],
"license": "Apache-2.0",
"optional": true,
- "peer": true,
"dependencies": {
"@img/sharp-wasm32": "0.35.1"
},
@@ -2153,7 +2140,6 @@
"os": [
"win32"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -2173,7 +2159,6 @@
"os": [
"win32"
],
- "peer": true,
"engines": {
"node": "^20.9.0"
},
@@ -2193,7 +2178,6 @@
"os": [
"win32"
],
- "peer": true,
"engines": {
"node": ">=20.9.0"
},
@@ -3416,6 +3400,7 @@
"resolved": "https://registry.npmjs.org/@nestjs/bull-shared/-/bull-shared-11.0.4.tgz",
"integrity": "sha512-VBJcDHSAzxQnpcDfA0kt9MTGUD1XZzfByV70su0W0eDCQ9aqIEBlzWRW21tv9FG9dIut22ysgDidshdjlnczLw==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"tslib": "2.8.1"
},
@@ -3584,6 +3569,7 @@
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.28.tgz",
"integrity": "sha512-bRImsxibie+AM7xjdwcrm/gr5YeacI65kSBNzTufa1Ib5iwziaY/lqMtRh9THq6pbV4e1HP9aI2ZxGUumnmaoQ==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"file-type": "21.3.4",
"iterare": "1.2.1",
@@ -3630,6 +3616,7 @@
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.28.tgz",
"integrity": "sha512-06m63xIRj8+l8uOeh/8LnYupGubkyu4f+bPKIadaSui6vK9KpXgoz7HveT1yOVLcEt0M0oCOEW5EuEXZkEmBBQ==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"fast-safe-stringify": "2.1.1",
"iterare": "1.2.1",
@@ -3689,6 +3676,7 @@
"resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-11.1.28.tgz",
"integrity": "sha512-hU+9Sz4m+onHrR5AmelI59QKmY/Re546bPnygnpqqeQdHDiJpBgjWbL4t6Jr73CBpS60cpyng7WzjgphNB9iwA==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"cors": "2.8.6",
"express": "5.2.1",
@@ -3710,6 +3698,7 @@
"resolved": "https://registry.npmjs.org/@nestjs/platform-socket.io/-/platform-socket.io-11.1.28.tgz",
"integrity": "sha512-vY+GmU2jBcymvgm5rEnftUx4qNxK8cDJmXjl1/1NcpITTNJo0vg07xYR43MwXHcMqe7b0jwqt5+UCTzxqQFIqA==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"socket.io": "4.8.3",
"tslib": "2.8.1"
@@ -3864,6 +3853,7 @@
"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-11.1.28.tgz",
"integrity": "sha512-jeyclAURCJTN8S8lctDhfLdiJeDKjZmYWWLav653Fb9hl9c+zx5jPhavI8Xk5++R8u+lX9qzaRxtsjEoxTtjyw==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"iterare": "1.2.1",
"object-hash": "3.0.0",
@@ -3915,6 +3905,7 @@
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
+ "dev": true,
"license": "MIT",
"optional": true,
"engines": {
@@ -4153,6 +4144,55 @@
"integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==",
"license": "MIT"
},
+ "node_modules/@thi.ng/bitstream": {
+ "version": "2.4.54",
+ "resolved": "https://registry.npmjs.org/@thi.ng/bitstream/-/bitstream-2.4.54.tgz",
+ "integrity": "sha512-uInkAJge5O0bWWEaYKrQpMccPbFg0z6eIA5NDCJXPm7l3rjlDje6RBHBXll3LiQz9Y051EdzlAEQRaB5hEifdg==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/postspectacular"
+ },
+ {
+ "type": "patreon",
+ "url": "https://patreon.com/thing_umbrella"
+ },
+ {
+ "type": "liberapay",
+ "url": "https://liberapay.com/thi.ng"
+ }
+ ],
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@thi.ng/errors": "^2.6.16"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@thi.ng/errors": {
+ "version": "2.6.16",
+ "resolved": "https://registry.npmjs.org/@thi.ng/errors/-/errors-2.6.16.tgz",
+ "integrity": "sha512-a7Lv/G0La5eTNUEIyLldpeYziyFSj3rOlWNeXFu8v+ZSb8w8EnQ/L0r0sKHux7Ru6RhUkAXrcaHU7xd1ZkWovA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/postspectacular"
+ },
+ {
+ "type": "patreon",
+ "url": "https://patreon.com/thing_umbrella"
+ },
+ {
+ "type": "liberapay",
+ "url": "https://liberapay.com/thi.ng"
+ }
+ ],
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@tokenizer/inflate": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.4.1.tgz",
@@ -4343,6 +4383,7 @@
"integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@types/estree": "*",
"@types/json-schema": "*"
@@ -4472,6 +4513,7 @@
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz",
"integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"undici-types": "~8.3.0"
}
@@ -4686,6 +4728,7 @@
"integrity": "sha512-CZ4nMxWwgu1HEEFNkeaCptra9QCtkmKdgf3sWh1rl1trIhmxLilgTV4cwcbQ4wemnT4sWQN8CaKOmdYx+g2gMA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.65.0",
"@typescript-eslint/types": "8.65.0",
@@ -5163,6 +5206,57 @@
"win32"
]
},
+ "node_modules/@wasm-audio-decoders/common": {
+ "version": "9.0.7",
+ "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/common/-/common-9.0.7.tgz",
+ "integrity": "sha512-WRaUuWSKV7pkttBygml/a6dIEpatq2nnZGFIoPTc5yPLkxL6Wk4YaslPM98OPQvWacvNZ+Py9xROGDtrFBDzag==",
+ "license": "MIT",
+ "dependencies": {
+ "@eshaz/web-worker": "1.2.2",
+ "simple-yenc": "^1.0.4"
+ }
+ },
+ "node_modules/@wasm-audio-decoders/flac": {
+ "version": "0.2.10",
+ "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/flac/-/flac-0.2.10.tgz",
+ "integrity": "sha512-YfcyoD2rYRBa6ffawZKNi5qvV5HArJmNmuMVUPoutuZ2hhGi6WNSWIzgvbROGmPbFivLL764Am7xxJENWJDhjw==",
+ "license": "MIT",
+ "dependencies": {
+ "@wasm-audio-decoders/common": "9.0.7",
+ "codec-parser": "2.5.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/eshaz"
+ }
+ },
+ "node_modules/@wasm-audio-decoders/ogg-vorbis": {
+ "version": "0.1.20",
+ "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/ogg-vorbis/-/ogg-vorbis-0.1.20.tgz",
+ "integrity": "sha512-zaQPasU5usRjUDXtXOHYED5tfkR4QMXd+EH3Nrz1+4+M5pCsdD+s9YxJqb0oqnTyRu/KUujOmu5Z/m/NT47vwg==",
+ "license": "MIT",
+ "dependencies": {
+ "@wasm-audio-decoders/common": "9.0.7",
+ "codec-parser": "2.5.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/eshaz"
+ }
+ },
+ "node_modules/@wasm-audio-decoders/opus-ml": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/opus-ml/-/opus-ml-0.0.2.tgz",
+ "integrity": "sha512-58rWEqDGg+CKCyEeKm2KoxxSwTWtHh/NLTW9ObR4K8CGF6VwuuGudEI1CtniS/oSRmL1nJq/eh8MKARiluw4DQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@wasm-audio-decoders/common": "9.0.7"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/eshaz"
+ }
+ },
"node_modules/@webassemblyjs/ast": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz",
@@ -5418,6 +5512,7 @@
"integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
"devOptional": true,
"license": "MIT",
+ "peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -5485,6 +5580,7 @@
"integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -5843,6 +5939,42 @@
"node": ">=8.0.0"
}
},
+ "node_modules/audio-buffer": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/audio-buffer/-/audio-buffer-5.0.0.tgz",
+ "integrity": "sha512-gsDyj1wwUp8u7NBB+eW6yhLb9ICf+0eBmDX8NGaAS00w8/fLqFdxUlL5Ge/U8kB64DlQhdonxYC59dXy1J7H/w==",
+ "license": "MIT"
+ },
+ "node_modules/audio-decode": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/audio-decode/-/audio-decode-2.2.3.tgz",
+ "integrity": "sha512-Z0lHvMayR/Pad9+O9ddzaBJE0DrhZkQlStrC1RwcAHF3AhQAsdwKHeLGK8fYKyp2DDU6xHxzGb4CLMui12yVrg==",
+ "deprecated": "Renamed to @audio/decode — same API; this name remains a thin alias. npm i @audio/decode",
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@wasm-audio-decoders/flac": "^0.2.4",
+ "@wasm-audio-decoders/ogg-vorbis": "^0.1.15",
+ "audio-buffer": "^5.0.0",
+ "audio-type": "^2.2.1",
+ "mpg123-decoder": "^1.0.0",
+ "node-wav": "^0.0.2",
+ "ogg-opus-decoder": "^1.6.12",
+ "qoa-format": "^1.0.1"
+ }
+ },
+ "node_modules/audio-type": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/audio-type/-/audio-type-2.4.2.tgz",
+ "integrity": "sha512-E9Bl1FGGDS81H/mKvaoPq0iQ8uT3qTBe6XWjipOo5kYrhLMAbjD7hREAVle0YJFahZOVbztxTdkwi0VBDJutSA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/audiojs"
+ }
+ },
"node_modules/b4a": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/b4a/-/b4a-1.8.0.tgz",
@@ -5970,6 +6102,7 @@
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz",
"integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==",
"license": "Apache-2.0",
+ "peer": true,
"peerDependencies": {
"bare-abort-controller": "*"
},
@@ -6122,6 +6255,7 @@
"integrity": "sha512-dq9AtApgg5PGFtBzPFSBl3HZQjHok5gaQCM6zh2Yk0aSmDCs1CbnVI8/HgASQkNKsWFpseIO9beg5xxpYhbIfA==",
"hasInstallScript": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"bindings": "^1.5.0",
"prebuild-install": "^7.1.1"
@@ -6246,6 +6380,7 @@
}
],
"license": "MIT",
+ "peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.10.12",
"caniuse-lite": "^1.0.30001782",
@@ -6336,6 +6471,7 @@
"resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.81.2.tgz",
"integrity": "sha512-Hi9GaVCC6HE9bQP65j/FNv1aL1fcEukTF99ezS5pl1Ud+joCFpNWiPCV45mWdkEmpuacS0XJdMMFGKPIHCwoPg==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"cron-parser": "4.9.0",
"ioredis": "5.11.1",
@@ -6510,6 +6646,7 @@
"integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"readdirp": "^4.0.1"
},
@@ -6579,13 +6716,15 @@
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz",
"integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==",
- "license": "MIT"
+ "license": "MIT",
+ "peer": true
},
"node_modules/class-validator": {
"version": "0.15.1",
"resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.15.1.tgz",
"integrity": "sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"@types/validator": "^13.15.3",
"libphonenumber-js": "^1.11.1",
@@ -6705,6 +6844,12 @@
"node": ">= 0.12.0"
}
},
+ "node_modules/codec-parser": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/codec-parser/-/codec-parser-2.5.0.tgz",
+ "integrity": "sha512-Ru9t80fV8B0ZiixQl8xhMTLru+dzuis/KQld32/x5T/+3LwZb0/YvQdSKytX9JqCnRdiupvAvyYJINKrXieziQ==",
+ "license": "LGPL-3.0-or-later"
+ },
"node_modules/collect-v8-coverage": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz",
@@ -7369,7 +7514,8 @@
"version": "0.0.1581282",
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1581282.tgz",
"integrity": "sha512-nv7iKtNZQshSW2hKzYNr46nM/Cfh5SEvE2oV0/SEGgc9XupIY5ggf84Cz8eJIkBce7S3bmTAauFD6aysMpnqsQ==",
- "license": "BSD-3-Clause"
+ "license": "BSD-3-Clause",
+ "peer": true
},
"node_modules/dezalgo": {
"version": "1.0.4",
@@ -7839,6 +7985,7 @@
"integrity": "sha512-nuKKvN+oIBO0koN7Tm7dlkmnkc21mtt0QJLwAKzjLq14y6lRTdVG36MZHJ8eQHwdJMwZbQNMlPOYedMq/oVJvQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"workspaces": [
"packages/*"
],
@@ -7898,6 +8045,7 @@
"integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",
"dev": true,
"license": "MIT",
+ "peer": true,
"bin": {
"eslint-config-prettier": "bin/cli.js"
},
@@ -8229,6 +8377,7 @@
"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
"integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"accepts": "^2.0.0",
"body-parser": "^2.2.1",
@@ -9026,6 +9175,7 @@
"resolved": "https://registry.npmjs.org/hono/-/hono-4.12.27.tgz",
"integrity": "sha512-1yrb/+w6HWQJrUCLkJ2IF5jNIPvvFkblV5RNOYl6bV+OA6p9GLcMpHFFGTosSvHvcAUibuUukRqhlYI4z32C7Q==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=16.9.0"
}
@@ -9440,6 +9590,7 @@
"integrity": "sha512-Yi1jqNC/Oq0N4hBgNH/YvBpP1P57QqundgytzYqy3yqAa7NZPNjSoi4SGbRAXDMdBzNE6xBCi5U7RgfrvMEUVQ==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@jest/core": "30.4.2",
"@jest/types": "30.4.1",
@@ -10683,6 +10834,19 @@
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
"license": "MIT"
},
+ "node_modules/mpg123-decoder": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/mpg123-decoder/-/mpg123-decoder-1.0.3.tgz",
+ "integrity": "sha512-+fjxnWigodWJm3+4pndi+KUg9TBojgn31DPk85zEsim7C6s0X5Ztc/hQYdytXkwuGXH+aB0/aEkG40Emukv6oQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@wasm-audio-decoders/common": "9.0.7"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/eshaz"
+ }
+ },
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -10987,6 +11151,15 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/node-wav": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/node-wav/-/node-wav-0.0.2.tgz",
+ "integrity": "sha512-M6Rm/bbG6De/gKGxOpeOobx/dnGuP0dz40adqx38boqHhlWssBJZgLCPBNtb9NkrmnKYiV04xELq+R6PFOnoLA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4.4.0"
+ }
+ },
"node_modules/node-webpmux": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/node-webpmux/-/node-webpmux-3.2.1.tgz",
@@ -11045,6 +11218,22 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/ogg-opus-decoder": {
+ "version": "1.7.3",
+ "resolved": "https://registry.npmjs.org/ogg-opus-decoder/-/ogg-opus-decoder-1.7.3.tgz",
+ "integrity": "sha512-w47tiZpkLgdkpa+34VzYD8mHUj8I9kfWVZa82mBbNwDvB1byfLXSSzW/HxA4fI3e9kVlICSpXGFwMLV1LPdjwg==",
+ "license": "MIT",
+ "dependencies": {
+ "@wasm-audio-decoders/common": "9.0.7",
+ "@wasm-audio-decoders/opus-ml": "0.0.2",
+ "codec-parser": "2.5.0",
+ "opus-decoder": "0.7.11"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/eshaz"
+ }
+ },
"node_modules/on-exit-leak-free": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz",
@@ -11109,6 +11298,19 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/opus-decoder": {
+ "version": "0.7.11",
+ "resolved": "https://registry.npmjs.org/opus-decoder/-/opus-decoder-0.7.11.tgz",
+ "integrity": "sha512-+e+Jz3vGQLxRTBHs8YJQPRPc1Tr+/aC6coV/DlZylriA29BdHQAYXhvNRKtjftof17OFng0+P4wsFIqQu3a48A==",
+ "license": "MIT",
+ "dependencies": {
+ "@wasm-audio-decoders/common": "9.0.7"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/eshaz"
+ }
+ },
"node_modules/ora": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz",
@@ -11379,6 +11581,7 @@
"resolved": "https://registry.npmjs.org/pg/-/pg-8.22.0.tgz",
"integrity": "sha512-8wih1vVIBMxoUM2oB4soJsD9tDnDpLv4OXBJ+EJzFsvycD+lfyIreC2gGHq78f8jbLLt+bvlPTFdFZfJkOuzAA==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"pg-connection-string": "^2.14.0",
"pg-pool": "^3.14.0",
@@ -11707,6 +11910,7 @@
"integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==",
"dev": true,
"license": "MIT",
+ "peer": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
@@ -12002,6 +12206,15 @@
"integrity": "sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==",
"license": "MIT"
},
+ "node_modules/qoa-format": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/qoa-format/-/qoa-format-1.0.1.tgz",
+ "integrity": "sha512-dMB0Z6XQjdpz/Cw4Rf6RiBpQvUSPCfYlQMWvmuWlWkAT7nDQD29cVZ1SwDUB6DYJSitHENwbt90lqfI+7bvMcw==",
+ "license": "MIT",
+ "dependencies": {
+ "@thi.ng/bitstream": "^2.2.12"
+ }
+ },
"node_modules/qrcode": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",
@@ -12344,7 +12557,8 @@
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",
"integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==",
- "license": "Apache-2.0"
+ "license": "Apache-2.0",
+ "peer": true
},
"node_modules/require-directory": {
"version": "2.1.1",
@@ -12444,6 +12658,7 @@
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
"integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==",
"license": "Apache-2.0",
+ "peer": true,
"dependencies": {
"tslib": "^2.1.0"
}
@@ -12780,6 +12995,16 @@
"simple-concat": "^1.0.0"
}
},
+ "node_modules/simple-yenc": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/simple-yenc/-/simple-yenc-1.0.4.tgz",
+ "integrity": "sha512-5gvxpSd79e9a3V4QDYUqnqxeD4HGlhCakVpb6gMnDD7lexJggSBJRBO5h52y/iJrdXRilX9UCuDaIJhSWm5OWw==",
+ "license": "MIT",
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/eshaz"
+ }
+ },
"node_modules/slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
@@ -13411,6 +13636,7 @@
"integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@@ -13749,6 +13975,7 @@
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
"devOptional": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@cspotcode/source-map-support": "^0.8.0",
"@tsconfig/node10": "^1.0.7",
@@ -13923,6 +14150,7 @@
"resolved": "https://registry.npmjs.org/typeorm/-/typeorm-1.1.0.tgz",
"integrity": "sha512-iX/kvsV42/htCNAQUyElGW87E4Z12neZc6YUFBTEu0BnLiREYDNT5Wfw3wRqZw9vyOEC36zUBAY6Qvywoig06Q==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"@sqltools/formatter": "^1.2.5",
"ansis": "^4.3.1",
@@ -14145,6 +14373,7 @@
"integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
"devOptional": true,
"license": "Apache-2.0",
+ "peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -14452,6 +14681,7 @@
"integrity": "sha512-wGN3qcrBQIFmQ/c0AiOAQBvrZ5lmY8vbbMv4Mxfgzqd/B6+9pXtLo73WuS1dSGXM5QYY3hZnIbvx+K1xxe6FyA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@types/eslint-scope": "^3.7.7",
"@types/estree": "^1.0.8",
@@ -14520,6 +14750,7 @@
"integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@@ -15009,6 +15240,7 @@
"resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz",
"integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==",
"license": "MIT",
+ "peer": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
diff --git a/package.json b/package.json
index eddddf2d5..0c5bf00f8 100644
--- a/package.json
+++ b/package.json
@@ -78,6 +78,7 @@
"@whiskeysockets/baileys": "7.0.0-rc13",
"adm-zip": "^0.6.0",
"archiver": "^8.0.0",
+ "audio-decode": "^2.2.3",
"better-sqlite3": "^12.11.1",
"bullmq": "^5.81.2",
"class-transformer": "^0.5.1",
diff --git a/src/engine/adapters/baileys-voice-waveform.spec.ts b/src/engine/adapters/baileys-voice-waveform.spec.ts
new file mode 100644
index 000000000..7ad60e036
--- /dev/null
+++ b/src/engine/adapters/baileys-voice-waveform.spec.ts
@@ -0,0 +1,53 @@
+import { readFileSync } from 'node:fs';
+import { join } from 'node:path';
+
+/**
+ * Baileys draws the amplitude bars on a voice note from `audio-decode`, which it declares as an
+ * OPTIONAL peer dependency and dynamically imports at send time. It was never installed, so the
+ * import threw on every send, was swallowed by a debug-level catch, and each voice note went out
+ * with no waveform at all — a silent failure with no signal anywhere above `debug`.
+ *
+ * This asserts the dependency is present and usable rather than re-testing Baileys' algorithm,
+ * which is not ours to pin. It cannot drive the real `getAudioWaveform` here: Baileys is ESM-only,
+ * every other Baileys spec in this repo mocks the package for exactly that reason, and a mocked
+ * module would prove nothing about whether the optional dependency actually resolves.
+ *
+ * The version check is the other half. Baileys asks for a specific major, and installing a newer
+ * one satisfies `require.resolve` while leaving the peer range unmet — the decoder is then present
+ * but Baileys' own contract is broken, which is precisely the shape a routine dependency bump takes.
+ */
+describe('Baileys voice-note waveform dependency', () => {
+ const readJson = (...segments: string[]): Record<string, unknown> =>
+ JSON.parse(readFileSync(join(__dirname, '..', '..', '..', ...segments), 'utf8')) as Record<string, unknown>;
+
+ it('is installed, so the waveform import does not throw at send time', () => {
+ expect(() => require.resolve('audio-decode')).not.toThrow();
+ });
+
+ it('is a declared dependency, not an accident of someone else’s tree', () => {
+ const pkg = readJson('package.json');
+ const deps = pkg.dependencies as Record<string, string>;
+
+ // Left to a transitive install it would vanish the moment that other package dropped it, and
+ // the failure would again be a debug-level line nobody reads.
+ expect(deps['audio-decode']).toBeDefined();
+ });
+
+ it('is the major version Baileys itself asks for', () => {
+ const baileys = readJson('node_modules', '@whiskeysockets', 'baileys', 'package.json');
+ const wanted = (baileys.peerDependencies as Record<string, string>)['audio-decode'];
+ const installed = readJson('node_modules', 'audio-decode', 'package.json').version as string;
+
+ // Guard the guard: if Baileys ever stops declaring it, this must fail loudly rather than
+ // silently comparing against undefined and passing.
+ expect(wanted).toBeDefined();
+
+ // Compared by major rather than by resolving the full range: a major mismatch is the failure
+ // that actually happens — the newest release installs cleanly, resolves fine, and quietly does
+ // not meet the peer range Baileys published. Doing it here keeps a semver parser out of the
+ // dependency list for one comparison.
+ const majorOf = (spec: string): string => /(\d+)\./.exec(spec)?.[1] ?? '';
+ expect(majorOf(installed)).toBe(majorOf(wanted));
+ expect(majorOf(installed)).not.toBe('');
+ });
+});