I would like to know if there is any way to create a source node ( https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MediaElementAudioSourceNode) from a soundcloud track.
I'm ok with the web audio API, but new to the soundcloud sdk, as far I understand it relies on soundmanager2. So maybe there is some options from soundmanager2 available?
Regards
To access the SoundCloud® API, you will first need to register your app at https://soundcloud.com/you/apps using your SoundCloud® account. When you've done that, we'll issue you with a client ID and client secret. Your client ID is required for all calls to the SoundCloud® API.
Our primary protocol is HLS (HTTP Live Streaming). This means the contents of a track are split up into short segments, and we have a separate file (playlist), which contains URLs to all of the segments, along with their corresponding times in the track.
The SDKs will make it easier to access the SoundCloud API on your framework of choice. We officially provide and support only JavaScript. All other SDKs (Ruby, Python) are supported by third-party developers.
You can request a track and then use stream_url
property, that you can set as src
for the audio element, to be used as MediaSourceNode.
Here's an example code:
var context = new webkitAudioContext(),
audio = new Audio(),
source,
// `stream_url` you'd get from
// requesting http://api.soundcloud.com/tracks/6981096.json
url = 'http://api.soundcloud.com/tracks/6981096/stream' +
'?client_id=YOUR_CLIENT_ID';
audio.src = url;
source = context.createMediaElementSource(audio);
source.connect(context.destination);
source.mediaElement.play();
Here's the example live: http://jsbin.com/ikixot/1/edit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With