From ed76185c15eed56c2f7103bb91e1a6b9cc1d35ac Mon Sep 17 00:00:00 2001 From: sprmn24 Date: Sun, 19 Apr 2026 13:11:25 +0300 Subject: [PATCH] feat(whatsapp): implement send_voice for audio message delivery WhatsApp already receives incoming voice messages (audio/ogg via the bridge) but lacked a send_voice implementation, so TTS and audio responses fell back to the base class send_image path instead of being delivered as native audio messages. Route send_voice through the existing _send_media_to_bridge helper with media_type='audio', matching the pattern used by send_video and send_document. --- gateway/platforms/whatsapp.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gateway/platforms/whatsapp.py b/gateway/platforms/whatsapp.py index dc097cf2d..b998da345 100644 --- a/gateway/platforms/whatsapp.py +++ b/gateway/platforms/whatsapp.py @@ -773,6 +773,17 @@ class WhatsAppAdapter(BasePlatformAdapter): """Send a video natively via bridge — plays inline in WhatsApp.""" return await self._send_media_to_bridge(chat_id, video_path, "video", caption) + async def send_voice( + self, + chat_id: str, + audio_path: str, + caption: Optional[str] = None, + reply_to: Optional[str] = None, + **kwargs, + ) -> SendResult: + """Send an audio file as a WhatsApp voice message via bridge.""" + return await self._send_media_to_bridge(chat_id, audio_path, "audio", caption) + async def send_document( self, chat_id: str,