From 6a19615a16fef3db8028ccff0554ab3e61d686e3 Mon Sep 17 00:00:00 2001 From: Renato Alcara Date: Wed, 25 Mar 2026 15:05:11 -0300 Subject: [PATCH] fix: respect caller-provided waveform for PTT audio messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When sending PTT audio with an explicit waveform, Baileys unconditionally overwrites it with getAudioWaveform() which returns undefined when audio-decode is not installed — resulting in a flat line on WhatsApp. Now only invokes getAudioWaveform() when no waveform is already provided, matching the existing pattern used for jpegThumbnail (line 241). Validated via CDP + Frida interception: WhatsApp waveform format is 64 bytes Uint8Array, values 0-99, byte-for-byte identical between Android (audio_data table) and WA Web (model-storage IDB). Ref: WhiskeySockets/Baileys#2443 Co-Authored-By: Renato Alcara --- src/Utils/messages.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils/messages.ts b/src/Utils/messages.ts index fe56a89e..a7d1f052 100644 --- a/src/Utils/messages.ts +++ b/src/Utils/messages.ts @@ -297,7 +297,7 @@ export const prepareWAMessageMedia = async ( logger?.debug('computed audio duration') } - if (requiresWaveformProcessing) { + if (requiresWaveformProcessing && !uploadData.waveform) { uploadData.waveform = await getAudioWaveform(filePath, logger) logger?.debug('processed waveform') }