This is the repository that houses music playing components via the command line by which the TAP Music interface interacts with for development purposes. Additional software is required for setting up streaming over a WAN network.
Windows is not directly supported by the node-spotify project.
This process is not an exact sience. OS paths will vary, compiling will vary, and you will be pulling your hair.
If you have not already, please install the TAP Music interface first. It'll help you have some of the more primary settings/configurations ready and available. The following instructions will primarly focus on the libspotify compiling and Installation to play music.
Please follow steps 1 - 4 in order.
- Spotify Developer Account Note: this requires a premium Spotify account.
- Node.js
- Pusher Note: this is a free service
- libspotify
Go to Spotify Account Keys and follow the instructions to create keys for the application. When you are done with the process, download the binary version of the key and DO NOT CHANGE THE DOWNLOAD NAME. This file will be moved as is into the location of the repository.
There are many ways to install on a Mac OSx system. The simplest way is via Homebrew.
$ brew update
$ brew install libspotify
NOTE: If brew spits out a nasty error, try doing what it says to do $ brew install /homebrew/binary/libspotify
NOTE: This is probably the worst method of installing the library. This is mainly meant for XCode applications that will utilize the framework.
Go to libspotify Downloads and download the Mac OS X/Darwin
version.
After the download, unzip it, and move the libspotify.framework to /Library/Frameworks/ directory.
Installing libspotify on a GNU Linux system couldn't be any easier. Simply to go libspotify Downloads and download the version that matches your systems architecture.
For example, if you have a 64bit Intel processor, it's a safe bet to download the x86_64
version. x86
is if your system is 32bit Intel. The other versions are for ARM/AMD processors.
After you download, untar the the download and then open up your terminal.
$ cd ~/Downloads/libspotify-12.1.51-Linux-xxxx-release
$ make install
This will install the GNU Linux version of libspotify in /usr/local/ directory.
NOTE: As specified in the README of the download, the install path can be changed to whatever you want, but keep in mind, node-spotify will run into issues as it is looking for the global install of the library in the /usr/local/ directory.
TODO
Time for the moment of truth!
Clone down the repository
$ git clone https://github.com/sgf-web-devs/tap-music-player
$ cd tap-music-player
Run the following command
$ npm install
This is the part of the install that gets hairy... Depending how you installed libspotify will determine what errors may arise.
The most likely problem you'll encounter is node-gyp locating the libspotify install in /usr/local/
On Mac OSx this may cause the most issues. If you're unable to resolve the problem, please post to the issues and we'll take a look at what you need to to. As a safe-bet, try installing it the GNU Linux way if you do not want to deal with the issues.
The most likely issue with Windows is the pthreads support.
Please have a look at POSIX Threads for Win32 to download and install POSIX Threads on Windows.
Additional solutions to come as people try to install this application.
NOTE: Configuration will be tracked in the repository. The application was thrown on github in a rush, and therefore proper configuration measure have not yet taken place to have a successfull pull on updates.
All configuration is handled in the routes/index.js file.
Replace
var socket = new PusherClient('YOUR KEY');
var my_channel = socket.subscribe('YOUR CHANNEL');
With your key
and my_channel_name
that you're using on the TAP Music Interface
Replace
var options = {
host: 'yourhost.com',
...
};
With the URI defined by your vhost from the TAP Music Interface
Replace
var pusher = new Pusher({
appId: 'YOUR ID',
key: 'YOUR KEY',
secret: 'YOUR SECRET'
});
With your app_id
, key
, and secret
from your Pusher App.
Replace
spotify.login('YOURUSERNAME', 'YOURPASSWORD', false, false);
With your username, and password from Spotify.
Lastly, move the downloaded ~/Downloads/spotify_appkey.key to the root of this project.
Simply run the following command in the root of the repository.
$ gulp
By default the player wont do anything, really. It will only play music once you load songs into the queue from the TAP Music interface.
There is a darkice.cfg sample file to use to optionally broadcast your audio to an icecast server.
TODO