Library to use the SoundCloud API in Processing.
Unzip and put the extracted SoundCloud folder into the libraries folder of your Processing sketches. Reference and examples are included in the SoundCloud folder. For more help read the tutorial by Daniel Shiffman.
- SoundCloud Java library (It's included internally.)
System:
- OSX (Mac OS X 10.7 and higher - tested with Mac OS X 10.10 Yosemite)
- Windows (not tested yet, but x86 and x64 should work) (Windows 7 and 8)
Processing version:
- 2.2.1
I recommend to use the library with Minim (GitHub). It uses JavaSound to provide an easy-to-use audio library while still providing flexibility for more advanced users.
import de.voidplus.soundcloud.*;
import ddf.minim.*;
SoundCloud soundcloud;
Minim minim;
AudioPlayer player;
void setup(){
// http://soundcloud.com/you/apps for APP_CLIENT_ID and APP_CLIENT_SECRET
soundcloud = new SoundCloud("APP_CLIENT_ID", "APP_CLIENT_SECRET");
// If you need any permissions:
// soundcloud.login("LOGIN_NAME", "LOGIN_PASS");
// show user details
User me = soundcloud.get("me");
println(me);
// play the first track of search
ArrayList<Track> result = soundcloud.findTrack("Chromatics");
if(result!=null){
println("Tracks: "+result.size());
minim = new Minim(this);
player = minim.loadFile(result.get(0).getStreamUrl());
player.play();
}
minim = new Minim(this);
}
void draw(){}
void stop(){
player.close();
minim.stop();
}
Don't be shy and feel free to contact me on Twitter: @darius_morawiec
MIT License by SoundCloud. The library is Open Source Software released under the MIT License.