Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to release buffers in Web Audio Api?
    primarykey
    data
    text
    <p>Hi guys I love Web Audio Api. The possibilities are fantastic. That being said its still in early stages. An what worries me most is that I have no idea how to release buffers / sounds that i no longer need. sound buffers with always new sontent since I will be mixing live sound from musicians / DJs / moderators connected via websockets</p> <p>the following code simulates load an playback of new buffers in a row. I need web audio api to add effects mixing and so everybody can hear live result with his performance</p> <p>Unfortunately this code eats whole ram and crashes both mobile and desktop safari. I have no idea how to release those large buffers once they vere played and I no longer need them .I really need to load new large data in their place in memory. Have anyone idea? Otherwise I am stuck with first 8 files played not able to load any more. </p> <pre><code>var context = new webkitAudioContext(); var total=0; function onTouchStart(){ setInterval(function(){ total+=10; source = context.createBufferSource(); source.connect(context.destination); // simulates loading large file source.buffer=context.createBuffer(1, 10*1024*1024, context.sampleRate); source.noteOn(0); source.noteOff(0); // acording to w3c spec resources should be deleted immediately. // making source property and call delete or =null will release nether source or buffer i am desperate. console.log(total,'mb'); // },1000); } document.addEventListener( "touchstart", onTouchStart ); document.addEventListener( "click", onTouchStart ); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload