whatsapp-api
whatsapp-api copied to clipboard
Evaluation failed: Error: getAudioDuration: error loading audio
Hello, while trying to send a media using client/sendMessage/ with the body:
{
"chatId": "[email protected]",
"contentType": "MessageMediaFromURL",
"content": "https://samples-files.com/samples/Audio/mp3/sample-file-4.mp3"
}
I'm getting the following error:
{
"success": false,
"error": "Evaluation failed: Error: getAudioDuration: error loading audio\n at new Error (<anonymous>:5:31)\n at e (https://web.whatsapp.com/:2:4914)\n at HTMLAudioElement.<anonymous> (https://web.whatsapp.com/app.1348daccac22f513cdcb.js:268:533788)"
}
The same happens if I try to get the file and send it in the base64 format, anyone know what should be done?
anyone?
Have you tried to send an ogg encoded file?
tried to send a base64 encoded ogg file, yes
Is it was like this https://github.com/chrishubert/whatsapp-api/issues/175#issuecomment-2005165933?
Hello I have the same problem. Is it possible that it is from the web cache remote?
Same issue here. I received an advise from @avoylenko to switch from chromium to google chrome. Working in progress. If someone test ealier, please share with us.
i got it working, here is my quick dockerfile
FROM node:20
COPY --from=chrishubert/whatsapp-web-api /usr/src/app /usr/src/app
# Set the working directory
WORKDIR /usr/src/app
# Install Google Chrome and dependencies
ENV CHROME_BIN="/usr/bin/google-chrome" \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true" \
NODE_ENV="production"
RUN set -x \
&& apt-get update \
&& apt-get install -y \
wget \
gnupg \
ca-certificates \
fonts-liberation \
udev \
--no-install-recommends \
&& wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Expose the port the API will run on
EXPOSE 3000
# Start the API
CMD ["npm", "start"]