Let the crowd make its own mix without hassling you.
Think about a web-based, crowd-powered jukebox that uses your audio player of choice in background.
- Local, searchable music database created from your audio files
- Support 8 audio formats (see below for the list)
- Support 11 audio players (see below for the list)
- Responsive (can be used on mobile devices)
- (Optional) Display the currently playing song
- Two queuing mode (vote or immediate)
- Time-based song submission restrictions
- Internationalized & localized in 2 languages:
- English (
en
) - French (
fr
)
- English (
- Should work on any Python 3.x version. Feel free to test with another Python version and give me feedback
- A uWSGI-capable web server (optional, but recommended)
- One of the supported audio players (see the Supported audio players section below)
- Clone this repo somewhere
pip install -r requirements.txt
pybabel compile -d translations
- IMPORTANT: Other dependencies are needed regarding the audio player you'll use. Please refer to the table in the Supported audio players section below and install them accordingly using
pip install <package>
before continuing export FLASK_APP=crowdmixer.py
(Windows users:set FLASK_APP=crowdmixer.py
)flask create_database
(WARNING: don't re-run this command unless you want to start from scratch, it will wipe out all the data)flask index
(this will index your songs. Don't forget to set theMUSIC_DIRS
configuration parameter before, read below. Runflask index --help
for the full list of arguments)
Copy the config.example.py
file to config.py
and fill in the configuration parameters.
Available configuration parameters are:
SECRET_KEY
Set this to a complex random value
More informations about Flask config values can be found here.
TITLE
If set to a string, will be used to replace the default app title (which is "CrowdMixer")FORCE_LANGUAGE
Force the lang to be one of the supported ones (defaults toNone
: auto-detection from theAccept-Language
HTTP header). See in the features section above for a list of available lang keysDEFAULT_LANGUAGE
Default language if it cannot be determined automatically. Not taken into account ifFORCE_LANGUAGE
is defined. See in the features section above for a list of available lang keysCACHE_THRESHOLD
The maximum number of items the cache will store before it starts deleting some (see here for more configuration parameters related to Flask-Cache)MUSIC_DIRS
A list of absolute paths to directories containing songs (read below for the list of supported formats)NOW_PLAYING_CACHE_TIME
Number of seconds the "Now playing" information will be stored in the cacheMODE
Submit mode that should be used. Can be eitherImmediate
(song is queued immediately) orVote
(song is queued when a votes threshold is reached)VOTES_THRESHOLD
IfMODE
is equal toVote
: number of votes required to actually queue a song in the playlistBLOCK_TIME
Define the number of seconds a song that have just been queued is unavailable for submittingREQUEST_LIMIT
Define the minimum number of seconds users have to wait between each submitSHOW_CURRENT_PLAYING
Enable or disable the display of the currently playing song (support may vary following the audio player used, more information in the Supported audio players section below)SONGS_PER_PAGE
How many songs to display per pagePLAYER_TO_USE
The audio player to use. Can be one of the ones in the table below, in the Supported audio players sectionPLAYERS
Self-explanatory audio players-specific configuration values. Change them if your audio player of choice (PLAYER_TO_USE
) is requiring it (see the table below, in the Supported audio players section)
I'll let you search yourself about how to configure a web server along uWSGI.
Some audio players needs to be themselves configured, you'll find the configuration instructions below according to your audio player of choice.
You'll have to enable the remote controlling feature of Clementine before to use CrowdMixer. To do so:
- In the menu bar of Clementine, click Tools > Settings...
- In the Remote control tab, check the Use remote control checkbox
- At this point, you can either use the default parameters, or customize them. If so, don't forget to change the configuration values of Clementine accordingly in your
config.py
- Click on OK
MPD, by design and by default, is only controllable via a TCP connection on *:6600
. You can change this behavior in
the /etc/mpd.conf
configuration file (depending of your operating system). If so, don't forget to change the configuration
values of MPD accordingly in your config.py
.
For more information, please read the MPD man page: man mpd.conf
or read the example configuration file.
You'll have to enable the web interface feature of VLC before to use CrowdMixer. To do so:
- In the menu bar of VLC, click Tools > Settings...
- On the bottom left of the Settings window, click on All in the Settings to display box
- In the left list box that has been shown, click on Interface > Main interface
- Check the Web checkbox
- In the left list box, click on Interface > Main interface > Lua
- In the Lua via HTTP > Password textbox, enter a password that will be required to remote control VLC. If you do not enter a password, remote control will not be possible for security reasons
- At this point, you can either save the settings, or customize them. For more information, please read the VLC documentation
Don't forget to change the configuration values of VLC according to your VLC settings in your config.py
.
- Standalone
Run the internal web server, which will be accessible at http://localhost:8080
:
python local.py
Edit this file and change the interface/port as needed.
- uWSGI
The uWSGI file you'll have to set in your uWSGI configuration is uwsgi.py
. The callable is app
.
- Others
You'll probably have to hack with this application to make it work with one of the solutions described here. Send me a pull request if you make it work.
This project is built on Flask (Python) for the backend which is using an
SQLite database to persist data. The flask index
command is used
to index the songs with the help of the tinytag package. Those songs
can then be browsed and submitted for playing using the web interface provided by Flask.
For more information about indexing, see the index()
function in the commands.py
file.
For more information about methods used to retrieve the currently playing song and to queue songs, see
the audioplayers.py
file.
CrowdMixer maintain its own music library database. The following audio file formats are supported by the CrowdMixer music indexer:
.mp3
,.m4a
.ogg
,.oga
,.opus
.flac
.wma
.wav
Make sure your audio player of choice also support these, otherwise you'll get errors while queuing songs.
CrowdMixer requires to be ran on the same computer that is running your audio player of choice.
Name | "Now playing" supported? | Configuration value | Additional PyPI dependencies | Needs additional configuration in config.py ? |
---|---|---|---|---|
AIMP | ✔ | Aimp |
pyaimp |
❌ |
Audacious | ❌ | Audacious |
psutil |
❌ |
Clementine | ✔ | Clementine |
protobuf |
✔ |
foobar2000 | ❌ | Foobar2000 |
psutil |
❌ |
MediaMonkey | ❌ | MediaMonkey |
psutil |
❌ |
MusicBee | ❌ | MusicBee |
psutil |
❌ |
Music Player Daemon | ✔ | Mpd |
python-musicpd |
✔ |
Rhythmbox | ✔ | Rhythmbox |
❌ | |
VLC | ✔ | Vlc |
requests |
✔ |
Winamp | ❌ | Winamp |
psutil |
❌ |
XMMS2 | ✔ | Xmms2 |
xmmsclient |
❌ |
The following audio players cannot be supported by CrowdMixer for technical reasons:
- Windows Media Player
- iTunes
If you have questions or problems, you can submit an issue.
You can also submit pull requests. It's open-source man!