• OK, so moved the pin and can hear a partial sound played.. (progress?).

    However, I can't get the whole file playing. If I set repeat:true then I can, but it's like an echo!

    function playSoundFile()
    {
    var f = E.openFile("/audio/1.raw","r");

    var w = new Waveform(2048, {doubleBuffer:true});
    // load first bits of sound file
    w.buffer.set(f.read(w.buffer.length));
    w.buffer2.set(f.read(w.buffer.length));
    var fileBuf = f.read(w.buffer.length);
    // when one buffer finishes playing, load the next one
    w.on("buffer", function(buf) {
    buf.set(fileBuf);
    fileBuf = f.read(buf.length);
    if (fileBuf===undefined) w.stop(); // end of file
    });
    // start output
    analogWrite(A4, 0.5);
    w.startOutput(A4,30000,{repeat:false});
    }

    1.raw attached...

    Struggling with this simple thing!!!!!


    1 Attachment

About

Avatar for pwhitrow @pwhitrow started