Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm looking for a terminal music player. mpg321/mpg123 is quite what I need, but it can't play all my music directory (which contains child directories). cmus seems to be a bit of an overkill, as there are a lot of features I never use.

I just need a program, that I can give it my music directory and perhaps a --random flag, then it will play everything with random orders. Can someone point out what options I have?

share|improve this question

6 Answers

up vote 8 down vote accepted

You can easily wrap up a script using find and rl (package randomize-lines on debian).

Something along the lines of:

find "$1" -type f -name *.mp3 | rl | while read FILE; do mpg123 "$FILE"; done
share|improve this answer
ha! I like this one the best :D – phunehehe Oct 2 '10 at 16:34
4  
If you don't have rl, sort -R accomplishes the same thing – Michael Mrozek Oct 3 '10 at 9:32
1  
@MrShunz I think it is find "$1" -type f -name *.mp3, typo? – phunehehe Oct 3 '10 at 11:35
@phunehehe eheh yeah typed that from memory... – Mr Shunz Oct 3 '10 at 12:19
@Michael Mrozek that's even better ... sort should be present by default in most distros... – Mr Shunz Oct 3 '10 at 12:20
show 2 more comments

I use gst123 as a command line player. Point it at the parent directory and it will shuffle through it and the child directories with the -z flag. I run it like this.

 gst123 -z ~/Music
share|improve this answer
this is actually nice, I'll try it some time, maybe when it's in the gentoo portage tree – phunehehe Oct 2 '10 at 16:36

You might try MPD it consists of a server backend and a separate frontend (which may but needn't run on the same machine). There are several great command line clients for it (see http://mpd.wikia.com/wiki/Clients)

share|improve this answer

There is moc - Music on console. It's simpler than mpd, but ships with embedded ncurses frontend. You can use ncurses TUI with mocp or talk to the server directly.

Of course it can't do all the nifty stuff mpd can do, like network streaming, different outputs simultaneosly, etc. But as a simple console player on local machine it's pretty usefull. It works without initial configuration, in contrast to mpd. The server starts automatically when mocp is called w/o parameters, or can be started manually.

start the server

mocp -S

tell the server to append (-a) a music folder to the playlist and to switch shuffle on (-o shuffle) and to start playing (-p)

mocp -o shuffle -p -a ~/mymusicfolder

I've 9.2 GB flac files and it only need 6 sec to load it from sata 1 hdd. from my sata 2 ssd it's instant. My output is alsa. (Didn't had to configure)

https://wiki.archlinux.org/index.php/Moc

share|improve this answer
Currently my mpd runs "unconfigured", just with built-in defaults and information detected on startup. – manatwork Oct 4 '11 at 7:15
oh, weird. According to wiki.archlinux.org/index.php/Mpd the user has to setup the files/folders with proper permissions, point to them in the config file and setup the sound devices at least. Maybe its destribution dependent. – kulpae Oct 4 '11 at 14:34
1  
Tried it again from zero and now indeed not created the ~/.mpd stuff. However my current working conf was certainly not created by me, as the files not match my naming convention. The audio_output device left unconfigured until present days and mpd automatically detects it on startup. BTW, it's also Alsa. Well, accept my upvote with apologies. – manatwork Oct 4 '11 at 15:09
Ah, thx for pointing out that audio output is autodetected, good to know ^^ Apology accepted with a comment vote up ;) We all are here to learn. – kulpae Oct 4 '11 at 15:19

I've spent some time fiddling with diverse minimalistic music players and today find myself especially partial to the relatively recent xmms21, a descendant (somewhat) of the venerable xmms music player.

It is a robust client-server application, designed to run full-featured from the command line or from multiple graphical clients, play practically any music encoding available, manage music collections while taking up as little processor time as possible.

share|improve this answer
You mean xmms2, right? It's my music player of choice. The background-daemon design is a good idea. – Jander Feb 11 '11 at 4:08

I just use mplayer. I generated a list of files from my music folders and mplayer can take that file as a playlist and play it in random order.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.