A C# wrapper for libspotify

Update 100114

The code is now hosted on github.

Example software built using libspotify-sharp: Servify. It is really nice combined with with roidify (same site). Check it out.

I'm planning on ensuring libspotify-sharp works with openspotify as that project goes along. When the project comes a little further we will get libspotify on Win32!

I have scribbled down an example on basic playlist handling for a mail reply. Check it out here.

Please follow instructions on github to download the source. If you want to collaborate just drop me a line (address is in the sources).

Update 091101

I haven't had much time to use or develop the library. Since my initial posting libspotify has been updated to version 0.0.2 and that broke my published code. The library is published under a very permissive license and the changes made by Spotify were small so I hoped that interested users would update it themselves and maybe some did. Here is however an updated version of libspotify-sharp for your late night C#-ing pleasure :-)


libspotify, is a C library for the Spotify music streaming service. Developing in C is a lot more time consuming than developing in C#. Sure, C has it's benefits but C# lets you produce great applications much more quickly.
libspotify-sharp wraps the C API into classes with kind of descriptive names like Track, Album, Artist etc. All callback mechanisms are wrapped as events. Reference counting is totally hidden from the programmer, so there is no need to bother about memory management. libspotify-sharp is thread safe and there is no need to periodically call some function to get things done. A lot of things are made easier for the programmer by using this library. Images are represented as System.Drawing.Bitmaps instead of pointers for example. Begin with looking at the supplied sample program, then study the source code. The demo project includes a .net wrapper (in C#) for libasound (ALSA). It might be of some use.


Download & usage

Download libspotify-sharp from github using your browser or git cloning. cd into project directory and run make.

If you have everything set up correctly the following should to the trick:

$ cd libspotify-sharp/
$ make
$ ./demo username password


Included is a MonoDevelop 2.0 solution file containing the two included projects. I really recommend version > 2.0 (and mono > 2.4) so you get a decent debugger. Setup MonoDevelop 2.0 and mono 2.4 on your box and start writing those libspotify apps you thought of but put on ice because of libspotify's unfriendliness :-)