Moved the render function outside, using requestAnimationFrame instead of drawing everytime an audio buffer is processed