OK I can do that. I thought I read somewhere in the forums that to make the code run on power up it would be best to have save at the end?
There is a start up sound but it's triggered from within onInit().
Sounds do get stopped/started partway through when needed. This is the stop/play code:
var AUDIOUT = A1;
function _playSoundFile(file)
{
LED3.write(1);
var filename = "/audio/" + file;
f = E.openFile(filename,"r");
w = undefined;
w = new Waveform(2048, {doubleBuffer:true});
w.buffers = [ w.buffer, w.buffer2 ];
w.buffer.set(f.read(w.buffer.length));
w.buffer2.set(f.read(w.buffer.length));
var fileBuf = f.read(w.buffer.length);
w.on("buffer", function(buf) {
buf.set(fileBuf);
fileBuf = f.read(buf.length);
if (fileBuf===undefined)
{
f.close();
_stopSoundFile();
}
});
analogWrite(AUDIOUT, 0.5, {freq:20000});
w.startOutput(AUDIOUT,8000,{repeat:true});
}
function _stopSoundFile()
{
LED3.write(0);
if (w && w.running) w.stop();
AUDIOUT.write(0);
w = undefined;
}
I would love to share details and full code with you dude as well as an overview of requirements, images and videos of performance, but this is an actively developing product and as such I have to protect the IP (it's a small but competitive arena that this will sit into when done). That said, I would be happier to send full details to your email if possible?
I feel this is really close to fully working and once done would be the best of it's kind within it's field, so would welcome your assistance in completing it, and could look at re-reimbursement for your time spent.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
OK I can do that. I thought I read somewhere in the forums that to make the code run on power up it would be best to have save at the end?
There is a start up sound but it's triggered from within onInit().
Sounds do get stopped/started partway through when needed. This is the stop/play code:
I would love to share details and full code with you dude as well as an overview of requirements, images and videos of performance, but this is an actively developing product and as such I have to protect the IP (it's a small but competitive arena that this will sit into when done). That said, I would be happier to send full details to your email if possible?
I feel this is really close to fully working and once done would be the best of it's kind within it's field, so would welcome your assistance in completing it, and could look at re-reimbursement for your time spent.