Node bindings for the libspotify C library
This is still very alpha, but you can already play around I suppose
Please note that you must have the libspotify library installed on your system you can get it from here.
You must provide your own spotify application key, because I'm not giving mine away :] You also must provide valid credentials for a spotify account.
Once you cloned the repository run
npm install then test the module with
As there are already a number of spotify bindings or modules for the REST API, the main goal
of this module is not to give access to the artist and tracks catalog. It's main purpose is
to allow for playback of the tracks. The idea is to expose a
Player object in which the user
can load tracks, play them, and get decompressed audio data from it (as provided by the libspotify C library).
What the user can do with the audio stream is up to him/her. As it is raw PCM data, it is easy to pipe to some kind of encoder (like gstreamer) in order to broadcast music or stream it to a web user (as long as it complies with the Spotify terms of service ;).
The main goal is now achieved. Audio data is exposed as the Player object which behaves like a readable stream.
Here is a code snippet of how to play a track from spotify
var sp = ;var cred = ;var spawn = spawn;var session =applicationKey: __dirname + '/../spotify_key/spotify_appkey.key';session;session;