From 9977bcc09322e9797d2933c023ddcb48fa201295 Mon Sep 17 00:00:00 2001 From: Pranav Date: Tue, 7 May 2024 23:10:54 -0700 Subject: [PATCH] fix: Convert audio file to mp3 before sending it to WhatsApp (#9432) Last week, the WhatsApp API has started returning an error message for the voice notes, Unsupported Audio mime type audio/opus. Please use one of audio/ogg; codecs=opus, audio/mpeg, audio/amr, audio/mp4, audio/aac. This error began appearing on May 1. Even though there was no change in the files and content type, FB API started rejecting the file. In this PR, we are converting the audio recordings from Wav to Mp3 from frontend itself. --- .../widgets/WootWriter/AudioRecorder.vue | 25 ++++++--- .../WootWriter/utils/mp3ConversionUtils.js | 53 +++++++++++++++++++ .../widgets/conversation/ReplyBox.vue | 7 +-- package.json | 1 + yarn.lock | 12 +++++ 5 files changed, 87 insertions(+), 11 deletions(-) create mode 100644 app/javascript/dashboard/components/widgets/WootWriter/utils/mp3ConversionUtils.js diff --git a/app/javascript/dashboard/components/widgets/WootWriter/AudioRecorder.vue b/app/javascript/dashboard/components/widgets/WootWriter/AudioRecorder.vue index 3722ea208..132408dc2 100644 --- a/app/javascript/dashboard/components/widgets/WootWriter/AudioRecorder.vue +++ b/app/javascript/dashboard/components/widgets/WootWriter/AudioRecorder.vue @@ -5,6 +5,7 @@