Skip to content

whisper-cli: add OGG/Opus to WAV conversion for WhatsApp voice notes #2048

Description

@giannisanni

Problem

whisper-cli (from whisper.cpp) only accepts WAV files, but WhatsApp sends voice notes as OGG/Opus. This causes transcription to fail silently when using the built-in whisper-cli auto-detection.

Proposed Solution

Add a wrapper script or built-in conversion step that uses ffmpeg to convert audio before passing to whisper-cli:

#!/bin/bash
# whisper-transcribe wrapper
INPUT="$1"
TMPWAV=$(mktemp /tmp/whisper-XXXXXX.wav)
trap "rm -f $TMPWAV" EXIT
ffmpeg -i "$INPUT" -ar 16000 -ac 1 -y "$TMPWAV" 2>/dev/null
whisper-cli --model "$WHISPER_CPP_MODEL" --no-timestamps "$TMPWAV" 2>/dev/null | grep -v "^\[" | grep -v "^whisper" | grep -v "^$"

Benefits

  • Local whisper transcription works out of the box with WhatsApp/Telegram voice notes
  • No external API keys needed
  • Uses ffmpeg which is commonly available

Environment

  • Clawdbot 2026.1.24-3
  • whisper.cpp (latest)
  • Ubuntu/Linux

Happy to submit a PR if this approach looks good! 🦞

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions