Skip to main content
Glama

wa-sound-sticker

License: MIT

Native WhatsApp Sound Stickers (audioStickerMessage, protobuf field 134) for Node.js, Baileys 7.x, CLI, and AI Agents (MCP / Hermes Agent) — without editing node_modules.

Turn any PNG, JPG, WebP, animated GIF, or short video (MP4/MOV/WebM) + local audio or MyInstants HTTPS URL into a real WhatsApp sound sticker (512x512 WebP with 0x5741 EXIF + 48 kHz mono Ogg/Opus) and send/decode it straight over Baileys or your AI agent.


Why this exists

Project

Creates 512x512 WebP + Opus

Sends Native WA Sound Sticker

Works Without Browser / WhatsApp Web

Baileys 7.x Zero-Touch

CLI & MCP / Agent Tool

SilverFeit/StikSound

ZIP / MP4 only

No

Desktop / Chrome

No

No

Shirtep/WA-audio-stickers

Yes (Browser)

Yes (via WA Web DOM)

No (Chrome extension)

No

No

wa-sound-sticker

Yes (ffmpeg + sharp)

Yes (field 134 wire proto)

Yes (pure Node.js)

Yes

Yes


Related MCP server: OpenWA MCP Server

How WhatsApp Sound Stickers Work on the Wire

WhatsApp sound stickers are not audio bytes stuffed inside a WebP. They are two separate encrypted media attachments linked inside one protobuf message:

  1. Sticker (image/webp, <= 950 KB): Animated WebP (512x512) carrying a big-endian TIFF EXIF chunk under tag 0x5741 ("WA") with JSON metadata including "sound-sha256" (base64 SHA-256 of the unencrypted Ogg/Opus file). Static images paired with audio are wrapped as a 1-frame animated WebP (isAnimated: true).

  2. Audio (audio/ogg; codecs=opus, <= 950 KB): Mono 48 kHz Ogg/Opus clip uploaded via the audio media path (ptt: false, cover-art streams stripped with -vn -map 0:a:0).

  3. Protobuf Envelope:

    Message {
      audioStickerMessage (134): FutureProofMessage {
        message (1): Message {
          stickerMessage (26): StickerMessage {
            ...fields 1..22...,
            premium (24) = 0,
            emojis (25) = "🔊",
            audioMessage (26): AudioMessage { mimetype = "audio/ogg; codecs=opus", ... }
          }
        }
      }
    }

Stock @whiskeysockets/baileys (7.0.0-rc13 / rc14) stops at field 114 and drops 134 (see Baileys#2932). wa-sound-sticker hooks proto.Message.encode and proto.Message.decode cleanly in memory at runtime so:

  • messages-send.js still sees stickerMessage and emits <message type="media"> + <enc mediatype="sticker"> + deviceSentMessage.

  • Outbound wire bytes serialize as field 134 -> 1 -> 26 -> (24, 25, 26).

  • Inbound sound stickers decode cleanly via extractSoundStickerInfo() / downloadSoundSticker().

  • Zero files in node_modules are touched.


Requirements

  • Node.js >= 20

  • ffmpeg & ffprobe available on PATH


Installation

npm install wa-sound-sticker

Or clone directly:

git clone https://github.com/alkhrzmy/wa-sound-sticker.git
cd wa-sound-sticker
npm install
npm test

Quickstart: Baileys 7.x (Zero-Touch)

Send a Sound Sticker

import { sendSoundSticker } from 'wa-sound-sticker';

// Image + local audio
await sendSoundSticker(sock, '6281234567890@s.whatsapp.net', {
  filePath: './meme.png',
  audioPath: './vine-boom.mp3',
  packName: 'My Stickers',
  publisher: '@alkhrzmy',
  emojis: ['🔊'],
});

// Short MP4/MOV meme using its own audio track, center-cropped 1:1
await sendSoundSticker(sock, '6281234567890@s.whatsapp.net', {
  filePath: './meme-short.mp4',
  useVideoAudio: true,
  fit: 'cover',
  packName: 'My Stickers',
  publisher: '@alkhrzmy',
});

// GIF + MyInstants URL
await sendSoundSticker(sock, '6281234567890@s.whatsapp.net', {
  filePath: './cat.gif',
  audioUrl: 'https://www.myinstants.com/en/instant/vine-boom/',
});

Receive & Download Inbound Sound Stickers

Call installSoundStickerCodec(proto) once before connecting your socket:

import { proto, downloadMediaMessage } from '@whiskeysockets/baileys';
import { installSoundStickerCodec, extractSoundStickerInfo, downloadSoundSticker } from 'wa-sound-sticker';

installSoundStickerCodec(proto);

sock.ev.on('messages.upsert', async ({ messages }) => {
  for (const msg of messages) {
    const info = extractSoundStickerInfo(msg);
    if (info?.hasAudio) {
      const { stickerBuffer, audioBuffer, emojis, audioSeconds } = await downloadSoundSticker(msg, {
        downloadOptions: {},
      });
      console.log('Received sound sticker:', { emojis, audioSeconds, webp: stickerBuffer.length, ogg: audioBuffer?.length });
    }
  }
});

CLI Usage

# 1. Convert locally to sticker.webp + sound.ogg
npx wa-sound-sticker convert \
  --image ./meme.mp4 \
  --video-audio \
  --fit cover \
  --pack "My Stickers" \
  --publisher "@handle" \
  --out ./out

# 2. Inspect EXIF + chunks of any sticker .webp
npx wa-sound-sticker inspect --file ./out/sticker.webp

# 3. Send through a running Hermes WhatsApp bridge
npx wa-sound-sticker bridge-send \
  --to "6281234567890@s.whatsapp.net" \
  --image ./meme.png \
  --audio ./sound.mp3

AI Agent Integration (MCP & Hermes Agent)

wa-sound-sticker ships a zero-dependency JSON-RPC 2.0 MCP stdio server (wa-sound-sticker-mcp) exposing three tools:

  • create_sound_sticker

  • send_sound_sticker_via_bridge

  • inspect_webp_sticker

Hermes Agent / Claude Code / Cursor MCP Config

{
  "mcpServers": {
    "wa-sound-sticker": {
      "command": "node",
      "args": ["/absolute/path/to/wa-sound-sticker/src/mcp.js"],
      "env": {
        "WA_STICKER_PACK_NAME": "My Stickers",
        "WA_STICKER_PUBLISHER": "@handle"
      }
    }
  }
}

See integrations/hermes/README.md and integrations/hermes/SKILL.md for the Hermes Agent skill and /send-sticker bridge route setup.


Caveats & Troubleshooting

  • Recipient client rollout: Meta is rolling out sound_stickers_consumption_enabled gradually across Android/iOS/Web clients. Clients without the feature enabled may render a silent sticker or an empty message.

  • Audio mimetype matters: Plain audio/ogg renders the sticker silently. audio/ogg; codecs=opus is required.

  • Cover art trap in MP3 -> OGG: Converting MP3s that carry embedded album art without -vn -map 0:a:0 embeds a video stream inside the .ogg, causing WhatsApp clients to silently fail playback. wa-sound-sticker strips non-audio streams automatically.

  • Size ceiling: Keep both WebP and Ogg/Opus under 1,000,000 bytes (950 KB safety cap enforced automatically via quality/bitrate stepdown).


Credits & References


License

MIT © Gymnastiar Al K (@alkhrzmy)

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Messaging tools for AI agents: send messages, manage chats, groups and channels.

      https://waapi.app/mcp/waapi
    • Official WhatsApp Business API (Meta Cloud API) for your own CRM or SaaS, from WasapFlow, a Meta Tech Provider. Your AI can search the Bridge docs, list connected numbers, create Embedded Signup links so clients connect their own WhatsApp (Coexistence supported), send text and template messages, list templates, check and retry failed webhooks, see usage and open support tickets. Docs tools work without a key; account tools use the x-partner-key header.

    • WhatsMCP connects Claude and other MCP-compatible AI agents directly to WhatsApp. Send and receive text, images, documents, and voice notes; manage groups (create, add/remove members, promote admins); look up contacts and profiles; follow channels; and read call and message history — all through a standard MCP interface. For voice use cases, WhatsMCP offers SIP-based calling plans (inbound-only, or full inbound/outbound) so AI voice agents can answer and place WhatsApp calls, plus low-latency WebSocket integrations with voice agent providers like ElevenLabs. Multiple WhatsApp accounts can be paired and managed per workspace, with webhook support for real-time inbound message delivery to your own infrastructure.

      https://api.whatsmcp.com/mcp
    • Carbon Voice MCP serves as a bridge that connects AI assistants like ChatGPT, Claude, and Cursor to a user's Carbon Voice account, turning voice messages and conversations into a private, on-demand knowledge base. It provides 28 specialized tools for comprehensive voice messaging management, including creating and sending messages, accessing conversation history with instant transcription, running AI actions (summarization, TLDR generation, meeting notes), and managing workspace collaboration through folders, contacts, and team communications.

      https://mcp.carbonvoice.app

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Bridges the WhatsApp HTTP API with AI assistants to enable full control over messaging, chat management, and interactive workflows through 63 specialized tools. It allows users to automate WhatsApp tasks and receive real-time AI feedback directly on their mobile devices.
      63
      6
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to manage WhatsApp sessions, send multi-format messages, control group participants, and configure webhooks by wrapping the OpenWA REST API with 44 tools.
      44
      2
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      Enables LLMs to interact with WhatsApp via the official WhatsApp Cloud API, providing tools for sending messages, templates, media, and managing conversations.
      13
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to manage WhatsApp instances, send messages and campaigns, handle incoming messages, webhooks, members, and metrics through 30 authenticated tools, with an optional WhatsApp-to-assistant bridge.
      Apache 2.0