Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

227
Vistas
How to download URL from CreateObjectURL and save it in a folder

I'm making a website that can record audio for 5 seconds, it works, but when the 5 seconds finish I want the audio to download or to be save in a folder of my project, is it posible? here is my code:

navigator.mediaDevices.getUserMedia({ audio: true })
  .then(stream => {
    const mediaRecorder = new MediaRecorder(stream);
    mediaRecorder.start();


    const audioChunks = [];

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

    });

    mediaRecorder.addEventListener("stop", () => {
      const audioBlob = new Blob(audioChunks)
      const audioUrl = URL.createObjectURL(audioBlob);
      const audio = new Audio(audioUrl);
      audio.play();
    });

And I want to make something like this

    mediaRecorder.addEventListener("stop", () => {
      const audioBlob = new Blob(audioChunks)
      const audioUrl = URL.createObjectURL(audioBlob);
      const audio = new Audio(audioUrl);
      audio.play();
      audio.save("direction-of-the-folder/") // MAKE this
    });

Thank you in advance:)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The File System Access API can provide access to the local file system (see tutorial). The recorded audioChunks can be also be downloaded via:

function download(audioChunks) {
  const a = document.createElement('a')
  a.href = URL.createObjectURL(new Blob(audioChunks))
  a.download = 'my-audio.webm'
  a.click()
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda