You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • The finish stuff seems to work for me? I just tried this:

    var BUZZER = B4;
    var s = atob("f4GBgoODh5GtnmgkE1m435g/MobgzYJbd4­1YHkHD/7UoEZPysyscl/K5PSqLy5tLToqdfHGdrX­I1V7vUeiVIqceEUG2kmWVfj6qIWFuKpZFpXXiXkn­NthZB9cH6LgG5vgJKSdWF7oZVoXHuRioJ8c3iJjH­tweomLf3JygpCHdHOCiYJ8fYCBg4ODgn53d4CGiI­Z8cHGAjo1+dn6Jh3pzeoWHfXd8hYd8d3+Gg3t1e4­F9d36KiHp0fYZ+cneLlol3cnyEgXt8g4WBeXV8ho­qDdnOCjoNxc4aRhnd3f4J6cXmNlIJxd4mKeXJ5iI­2Denh9fX1/f4B/g4N2bnuSlYJzdoOIgXp7g4V+dn­mDhoF9gIF+eHqDioJyb3+Oi3xzeIOHgXp7gIB+fH­+DgHt8hIh/cnOEjoVzb32Mi3pxeYeLf3N2hIqBdX­aBhoB7fYSGfXZ7hYeAeXl9goJ9e36BgYGCgoF8e4­GDgHp6f4ODgHo=");
    var w = new Waveform(s.length);
    w.buffer.set(s);
    
    analogWrite(BUZZER, 0.5, {freq:20000}); 
    w.on('finish', function() {
      print("Finished!");
    });
    w.startOutput(BUZZER,2000);
    

    And it prints Finished! when done. There shouldn't be any difference between that and loading from a file though, as the Waveform is exactly the same.

    I'm afraid it's not possible to play directly from flash, but you could use double-buffering and read it in chunks very easily.

About

Avatar for Gordon @Gordon started