Skip to content

Instantly share code, notes, and snippets.

View vick08's full-sized avatar
💭
Writing things!

Victor Tsaran vick08

💭
Writing things!
View GitHub Profile
@vick08
vick08 / audiosprite.js
Created February 8, 2012 04:33 — forked from remy/audiosprite.js
An example of how an audio sprite can be used (includes fixes for iOS)
function Track(src, spriteLength, audioLead) {
var track = this,
audio = document.createElement('audio');
audio.src = src;
audio.autobuffer = true;
audio.load();
audio.muted = true; // makes no difference on iOS :(
/* This is the magic. Since we can't preload, and loading requires a user's
input. So we bind a touch event to the body, and fingers crossed, the