• I am trying to read the content of a raw audio file into the trace. I would much rather the ability to read in chunks (of my choosing), but from looking at the API it would suggest (to me) that it's an all or nothing operation. Anyway, I wanted to confirm the content is reading in the way I am expecting (I am porting a PIC project over).

    I have the following code

    clearInterval();
    
    var fs = require('fs');
    var files = fs.readdir();
    if (files.length > 0) {
      var filename = files[0];
      trace(filename);
      var content = fs.readFileSync(filename);
      trace(content);
    }
    

    Now I am seeing the filename is correct, however the WebIDE hangs when it comes to doing the trace for the file content. It will not even let me disconnect. After 5 minutes of nothing, I hit the reset button, and it's back to normal...

    I would like to assume that it's trying to read the entire file into memory and then falling over.

    Am I doing something wrong? Any suggestions?

About

Avatar for Cyber-Lane @Cyber-Lane started