Skip to main content
Participant
September 20, 2023
Answered

decode audio in base64 in extendscript premiere pro

  • September 20, 2023
  • 1 reply
  • 498 views

Hello
I am making a plugin in premiere pro with extendscript in the html and javascript, I am obtaining an .mp3 audio of which comes from api rest, I pass the audio to extendscript in base64 and I would like to know if there is any way to decode the audio in base64 in extendscript to save the file to the device, the code that I will provide you does not work for me

 

saveAudio: function (data,rutaArchivo) {
// Crear un objeto File para el archivo de texto
    var archivo = new File(rutaArchivo);
    archivo.encoding = "ASCII";
    // Abrir el archivo en modo de escritura
    if (archivo.open("w")) {
      var decode =atob(data)
      // Escribir el string en el archivo
      var datatemp=archivo.write(decode);
      $.IA.alertEventPanel("Se guardo: ",datatemp)
      // Cerrar el archivo
      archivo.close();

      alert("Archivo creado con éxito.");
    } else {
      alert("Error al crear el archivo.");
    }
}

 

This topic has been closed for replies.
Correct answer Bruce Bullis

I'll refresh my memory on the File object (https://extendscript.docsforadobe.dev/file-system-access/file-object.html), and...

Any way you could handle this at the JavaScript level? Maybe with a command line? [CEP HTML Test Extension shows command line usage from within a panel.]

1 reply

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
September 20, 2023

I'll refresh my memory on the File object (https://extendscript.docsforadobe.dev/file-system-access/file-object.html), and...

Any way you could handle this at the JavaScript level? Maybe with a command line? [CEP HTML Test Extension shows command line usage from within a panel.]