aldinokemal / go-whatsapp-web-multidevice

API for Whatsapp Web Multi Device Version, Support UI & Webhook
MIT License
582 stars 245 forks source link

Send Audio not working #113

Closed miguel-arrf closed 9 months ago

miguel-arrf commented 9 months ago

Hi!

I'm trying to send a MP3 file. When I do it, (in the dashboard) it appears as if it succeeded, however I'm not receiving anything. If I try to send the MP3 file as a file using the file endpoint and not the audio one, it works.

Does anyone have any clue what I might be doing wrong?

Thank you!

aldinokemal commented 9 months ago

have you tried using another mp3 file?

miguel-arrf commented 9 months ago

Yup! I've tried multiple mp3 files and also m4a.

Here's the debug message, where apparently everything is working well.

2024-02-08 15:05:46 go-whatsapp-web-multidevice-whatsapp_go-1  | 15:05:46.283 [Client/Send DEBUG] <message id="3EB012917413AB82327321" to="351[MY_PHONE_NUMBER]@s.whatsapp.net" type="media"><participants><to jid="351[MY_PHONE_NUMBER]@s.whatsapp.net"><enc mediatype="audio" type="msg" v="2"><!-- 599 bytes --></enc></to><to jid="351[MY_PHONE_NUMBER]:27@s.whatsapp.net"><enc mediatype="audio" type="pkmsg" v="2"><!-- 680 bytes --></enc></to><to jid="351[MY_PHONE_NUMBER]:33@s.whatsapp.net"><enc mediatype="audio" type="pkmsg" v="2"><!-- 683 bytes --></enc></to><to jid="351[MY_PHONE_NUMBER]:46@s.whatsapp.net"><enc mediatype="audio" type="pkmsg" v="2"><!-- 663 bytes --></enc></to><to jid="351[MY_PHONE_NUMBER]@s.whatsapp.net"><enc mediatype="audio" type="msg" v="2"><!-- 599 bytes --></enc></to><to jid="351[MY_PHONE_NUMBER]:27@s.whatsapp.net"><enc mediatype="audio" type="pkmsg" v="2"><!-- 664 bytes --></enc></to><to jid="351[MY_PHONE_NUMBER]:33@s.whatsapp.net"><enc mediatype="audio" type="pkmsg" v="2"><!-- 667 bytes --></enc></to><to jid="351[MY_PHONE_NUMBER]:46@s.whatsapp.net"><enc mediatype="audio" type="pkmsg" v="2"><!-- 679 bytes --></enc></to></participants><device-identity><!-- 186 bytes --></device-identity></message>

2024-02-08 15:05:46 go-whatsapp-web-multidevice-whatsapp_go-1  | 15:05:46.462 [Client/Recv DEBUG] <ack class="message" from="351[MY_PHONE_NUMBER]@s.whatsapp.net" id="3EB012917413AB82327321" t="1707404746"/>

"351[MY_PHONE_NUMBER]" is, well, my phone number. 351 is the country identifier. Regardless of the phone number and the file, it doesn't seem to work. Sending a file on its own, it does :/

If you have any MP3 file I can test, it could be a good way to understand what's happening!

aldinokemal commented 9 months ago

Have you checked with a different WhatsApp account? Nothing is wrong on my end.

aldinokemal commented 9 months ago

https://file-examples.com/wp-content/storage/2017/11/file_example_MP3_700KB.mp3

traysh commented 9 months ago

Working for me too

miguel-arrf commented 9 months ago

Just tried with a different account and it is still not working (with that file). The only way I got it working was by converting it from MP3 to OOG and using the Opus encoding.

I found one whatsmeow discussion that gave me this hint.

If it is working for other people I'll close the issue. Thank you for the help!