Skip to content

Instantly share code, notes, and snippets.

@leemartin
Created March 9, 2012 00:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leemartin/2004387 to your computer and use it in GitHub Desktop.
Save leemartin/2004387 to your computer and use it in GitHub Desktop.
Wave64 Example
// Use the SoundCloud JS SDK to grab a track
SC.get("/tracks/38640984", function(track){
// Use jQuery's getJSON call to pass the waveform_url and callback to Wave64
$.getJSON('http://wave64.it/w?callback=?', { url: track.waveform_url }, function(data){
// Initialize a new image using the returned data
waveform = new Image();
waveform.src = data.data;
// Wait for the image to load...
waveform.onload = function(){
// Now do something with the waveform data, like throwing it on a canvas
context.putImageData(waveform, 0, 0);
};
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment