WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.1k stars 1.07k forks source link

[BUG] Error playing audio on iOS/WA (Windows) devices #768

Open juniorkrz opened 2 months ago

juniorkrz commented 2 months ago

There is an issue I noticed regarding audio/PTT messages, they are sent normally, but some devices cannot play the message.

Devices that don't work: iOS, WhatsApp (Windows) Devices that work: Android, WhatsApp Web

My code:

client.sendMessage(
  message.key.remoteJid,
  { audio: { url: path }, ptt: true, mimetype: 'audio/mp4' },
  { quoted: message, ephemeralExpiration: WA_DEFAULT_EPHEMERAL }
)

issue

Alien-Alfa commented 1 month ago

use mimetype: 'audio/mpeg' it will work both in iOS and android

codespearhead commented 1 month ago

@juniorkrz Did the above suggestion work? If so, can you close this issue?

juniorkrz commented 1 month ago

use mimetype: 'audio/mpeg' it will work both in iOS and android

@Alien-Alfa Thanks for the suggestion, but this didn't work for me.

@juniorkrz Did the above suggestion work? If so, can you close this issue?

@codespearhead The problem persists on iOS/Windows devices, only works on Android/WhatsApp Web

Windows:

windows

iOS:

iOS

codespearhead commented 1 month ago

Try audio/ogg; codecs=opus:

https://github.com/WhiskeySockets/Baileys/blob/79c33e53b4124735f019c48e8075c9cde807b7e7/src/Utils/messages.ts#L52

Possibly related: #501

juniorkrz commented 1 month ago

Try audio/ogg; codecs=opus:

https://github.com/WhiskeySockets/Baileys/blob/79c33e53b4124735f019c48e8075c9cde807b7e7/src/Utils/messages.ts#L52

Possibly related: #501

@codespearhead This way it didn't work on Android or iOS