• Update: tried new headphone its much louder than the last one and your code worked. Though still having similar problems as before with playing a voice recording. The code we are using is posted below.

    // SD card setup
    //DI(mosi) = B15
    //DO(miso) = B14
    //CK(sck = B10
    //CS(CD pin) = B1
    var spi = new SPI(); 
    spi.setup({mosi:B15, miso:B14, sck:B10});
    E.connectSDCard(spi, B1);
    var f = E.openFile("X-File.raw","r");
    var w = new Waveform(2048,  {doubleBuffer:true});
    // load first bits of sound file
    var fileBuf = f.read(w.buffer.length);
    // when one buffer finishes playing, load the next one
    w.on("buffer", function(buf) {
      fileBuf = f.read(buf.length);
      if (fileBuf===undefined) w.stop(); // end of file
    // start output
    analogWrite(A7, 0.5);

    Where "X-File.raw" is a file I made in audacity using the guide lines provided in the waveform documentation and is in the proper format of .raw(header-less) unsigned 8-bit PCM with a 8000hz playback speed. As I play the file I can accurately make out each spoken word in the sentence however it is very fuzzy to the point where you can barely make out the words and a single high pitch tone can be heard overtop of that audio. Can you recommend anything that can possibly fix this?


Avatar for jruroede @jruroede started