noobe
Posts: 6
Joined: Sun Aug 24, 2014 10:50 am

Raspberry Pi to shuffle music (user input)

Tue Sep 02, 2014 6:18 pm

I am inquiring whats the best way to go about using python to shuffle music on the raspberry pi what I would like to do is do this via user input to determine what song to play.

Any help would be much appreciated :)

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Raspberry Pi to shuffle music (user input)

Wed Sep 03, 2014 2:37 am

you can randomize a playlist with

Code: Select all

random.randint(0, len(playlist))
or you could just use a per-built solution like ncmpc, mpd, ampache, subsonic, etc
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

noobe
Posts: 6
Joined: Sun Aug 24, 2014 10:50 am

Re: Raspberry Pi to shuffle music (user input)

Wed Sep 03, 2014 12:52 pm

Is there a program you need to import in order to do it ? What would you say from the options you choose is the most credible music player...

theoscy
Posts: 44
Joined: Fri Apr 05, 2013 10:42 pm

Re: Raspberry Pi to shuffle music (user input)

Wed Sep 03, 2014 7:52 pm

In my opinion pyglet is the most credible music playing module. To install it in python 3.4:
pip install pyglet
pip install --upgrade http://pyglet.googlecode.com/archive/tip.zip
Then download the latest Alpha for your system from:
https://github.com/AVbin/AVbin/downloads

Then check the Pyglet docs on how to play songs, very simple. - http://www.pyglet.org/documentation.html

Then you would need to impliment a way to shuffle songs in a particular directory and then play them accordingly.
You could say my love for Linux is terminal ;)

Return to “General discussion”