Skip to content

Instantly share code, notes, and snippets.

@Breefield
Created September 14, 2012 07:31
Show Gist options
  • Save Breefield/3720520 to your computer and use it in GitHub Desktop.
Save Breefield/3720520 to your computer and use it in GitHub Desktop.
Every frame
if(typeof hyperlips.waveform == 'undefined') return false;
ctx.strokeStyle = 'rgba(255, 255, 255, 1)';
ctx.lineWidth = 1;
ctx.lineJoin = 'round';
ctx.beginPath();
ctx.moveTo(0, canvas.height - 15);
for(var i = 0; i < hyperlips.waveform.points.length; i++) {
ctx.lineTo((canvas.width / hyperlips.waveform.points.length) * (i + 1), canvas.height - 15 + Math.ceil(hyperlips.waveform.points[i] * 10));
}
ctx.stroke();
ctx.closePath();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment