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

627
Views
Node.js: ¿cómo obtener la duración del archivo de audio remoto?

Tengo un depósito de almacenamiento de binarios (en Firebase Storage) y estoy implementando una función de nube node.js que obtiene un audio (audio/m4a o audio/caf), verifica su formato y duración, y luego asocia su uri con un documento en mi base de datos (o elimina el archivo de audio si su duración no es válida).

Antes de crear el documento en mi base de datos, necesito validar el archivo de audio.

Para descargar los archivos del almacenamiento, estoy usando esta función:

 exports.downloadBinaryFileFromUrl = function (fileUrl) { /* This function downloads a binary-encoded file from its URL and returns it */ return axios .get(fileUrl, { responseType: "arraybuffer", }) .then((res) => Buffer.from(res.data, "binary")) .catch((err) => { if (err.response) { /* The request was made and the server responded with a status code that falls out of the range of 2xx */ throw err.response.data; } else if (err.request) { // Client never received a response, or request never left throw err.request; } else { // Something happened in setting up the request that triggered an Error throw new Error(`Error: ${err.message}`); } }); };

¿Alguna idea de cómo obtener la duración del archivo de audio usando Node.js?

over 4 years ago · Santiago Trujillo
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!