Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
Convert Blob audio file to mp4 type in javascript

I'm trying to convert a blob audio file to .mp4 type which is generated from MediaRecorder it is returning with webm type and I have tried other types in MimeType(attribute in MediaRecorder to set the type) but they are not supported so I have tried ffmpeg npm library but it was asking for path of the file but i'm not saving it so that also didn't work for me. Any suggestion and answer that will help!!

This is how I'm recording it and it is working fine

 const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
 const mediaRecorder = new MediaRecorder(stream);
  const audioChunks = [];

mediaRecorder.addEventListener("dataavailable", event => {
  audioChunks.push(event.data);
});
const start = () => mediaRecorder.start();

const stop = () =>
  new Promise(resolve => {
    mediaRecorder.addEventListener("stop", async () => {
      const audioBlob = new Blob(audioChunks,{
        'type': 'audio/wav;' 
      });
      const audiomp3 = URL.createObjectURL(audioBlob);
      const audio = new Audio(audiomp3);
      const play = () => audio.play();
      resolve({ audioBlob,audio,play });
    });
    
    mediaRecorder.stop();
  });

This is the link i refer for ffmpeg

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!