Created
March 9, 2012 00:48
-
-
Save leemartin/2004387 to your computer and use it in GitHub Desktop.
Wave64 Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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