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

208
Views
¿Cómo cargaría un archivo ogg en el nodo js?

Mi objetivo es cargar archivos ogg en node.js. Probé ReadFile pero me aparece este error: No se pudo leer el archivo. [Error: ENOENT: no existe tal archivo o directorio, abra 'Main\game\songs\test\Voices.ogg'] y el archivo existe.

Código:

 fs.readdir('./game/songs', function(err, files){ if (err) { console.log("Could not list the directory.", err) return } files.forEach(function(file, index){ fs.readFile('./game/songs/'+file+"/Inst.ogg", function(err, data){ if (err) { console.log("Could not read file.", err) return } }) fs.readFile('./game/songs/'+file+"/Voices.ogg", function(err, data){ if (err) { console.log("Could not read file.", err) return } }) }) })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe pasar la ruta absoluta del archivo, use la función join() del módulo de path incorporado:

 const path = require('path'); const fs = require('fs'); fs.readFile(path.join(__dirname, 'YOUR_PATH_HERE'), function(err, data) {});
about 4 years ago · Juan Pablo Isaza Report
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!