49

What are popular audio players for the command line?

  • How to play a single sound file?
  • Are there command line players that also index the music library like Banshee, Exaile, etc.?

14 Answers 14

33

I have compiled a complete list of commandline and other lightweight tools for linux: Best Lightweight Applications for Linux. It also has a list of other music players.

Here is my personal favorite: cmus.

cmus

  • Thanks, CMUS looks great, do u know also MOC and if why do you prefer CMUS? Cheers – type May 22 '11 at 13:36
  • i never used MOC before, but it looks good I will check it out. – hsinxh May 22 '11 at 13:39
  • 1
    @Harbhag could you please add a picture and a small description (makes a 1st impresssion comparison with other answers easier) – Rinzwind May 22 '11 at 13:49
  • 1
    cheers, i guess screen/byobu is similar and available from the ubuntu repository if not installed by default yet --- interesting nevertheless: wikivs.com/wiki/Screen_vs_tmux / tmux.cvs.sourceforge.net/viewvc/tmux/tmux/FAQ – type May 22 '11 at 14:05
  • 1
    @type I've written a wiki page that explains how to add a little extra sugar to cmus so that it is automatically detachable/re-attachable: cmus.sourceforge.net/wiki/doku.php?id=detachable_cmus – jmuc Dec 12 '11 at 13:56
14

MOCInstall moc

With MOC we have a powerful commandline player that is capable of browsing directories, generates playlist can can even be extended with plugins, e.g. for lastFM streams.

enter image description here

  • Thanks, also looks great, do u know also CMUS and if why do you prefer MOC? Cheers – type May 22 '11 at 13:37
  • I found MOC a bit easier to handle, but that's maybe only my personal taste. – Takkat May 22 '11 at 13:48
  • MOC's default config is more 'directory' oriented behavior as opposed to other players and launch daemon at first time, you can keep playing while quitting moc interface. – Mait Dec 21 '13 at 4:57
  • The first image on this answer is down. – Calculus Knight Nov 21 '15 at 13:16
7

Install vorbis-tools (sudo apt-get install vorbis-tools) to get ogg123:

$ ogg123 -v example.ogg 

Audio Device:   Advanced Linux Sound Architecture (ALSA) output
Author:   Bill Currie <bill@taniwha.org>/Kevin Cody, Jr. <kevinc@wuff.dhs.org>
Comments: Outputs to the Advanced Linux Sound Architecture version 0.9/1.x

Playing: example.ogg
Ogg Vorbis stream: 1 channel, 44100 Hz
Vorbis format: Version 0
Bitrate hints: upper=0 nominal=160000 lower=0 window=0
Encoded by: Xiph.Org libVorbis I 20101101 (Schaufenugget)
Encoded by: SONY IC RECORDER MP3 1.1.0
Album: ptiha
Date: 2012
Artist: Michael Laitman
Time: 00:42.17 [218:51.85] of 219:34.02  (142.0 kbps)  Output Buffer  88.9%

ogg123 reads Ogg Vorbis audio files and decodes them to the devices specified on the command line. By default, ogg123 writes to the standard sound device, but output can be sent to any number of devices. Files can be read from the file system, or URLs can be streamed via HTTP. If a directory is given, all of the files in it or its subdirectories will be played.

  • The image on this answer is down. – Calculus Knight Nov 21 '15 at 13:17
5

mpd (daemon) + ncmpcpp (client/interface):

ncmpcpp

MPD is able to scan a directory and create a music library from its ID3 tags. Ncmpcpp has a library view which lets you add songs/albums/artists to the current playlist, search for tags and edit them in place.

  • Yes, I like mpd too... but let's be fair and point out tha's basically the vim of the music players. Can support just about anything on could think of, eg. in terms of controlls and multiple in- and outputs, varying freely in in format and transport as needed. But - right, when combined with ncmpcpp as you show, it more like gvim - in a pretty good way! – Volker Siegel Jun 27 '14 at 3:59
5

VLC has a command line interface. MPlayer has also a command line interface, but I am not sure if it can play audio as well.

  • 2
    VLS has a great ncurses interface cvlc -I ncurses musique/* – meduz Oct 15 '13 at 8:22
  • It is possible to run it in dark mode? – Vitaly Zdanevich Jan 25 '17 at 4:33
5

mpg123 Install mpg123

mpg123 is a fast, free and console MPEG audio player software program for UNIX and Linux operating systems. mpg123 was ported to the Windows platform using Cygwin and MinGW. It supports MPEG-1 and -2, layers 1, 2 and 3. Its most common use is to play MP3 files. It also comes as a Winamp plugin.

im1

  • 3
    Let's not forget ogg123! – daithib8 May 25 '11 at 20:50
  • make it an answer! I get 1 to name so you can make that one :D – Rinzwind May 25 '11 at 20:51
  • who ever it was: care to explain the downvote? – Rinzwind Aug 3 '12 at 21:05
4

I like mplayer. It's very basic player, but sometimes I find it very useful (for example, I can specify it manually the audio driver I want it to use).

To play a file: mplayer file

As far as I know it cannot manage playlists.

  • It can play playlists if not manage them – M.T Sep 9 '16 at 7:02
4

namp

namp - ncurses audio media player - is a minimalistic console-based audio player for Linux (and macOS). In addition to Winamp keybindings operation it also supports mouse control. The audio formats supported is determined by the underlying system, but generally mp3, wav, flac, etc should work fine.

namp screenshot

How to play a single sound file:

namp ~/Music/Hello.mp3

Full disclosure: I'm the author of namp. I used cmus, moc and mpd before finally settling on writing my own (very simple) audio player. It's currently not available via apt so you need to copy & paste some commands from the link above to build it from sources.

  • 1
    d99kris This app is great! Perfect amount of features before getting overly complicated and making me crave a GUI music player. – Tom Oct 10 '17 at 14:33
2

Just write one line in terminal;) and listen to radio streams

for OGG/OPUS streams

wget -qO- http://ai-radio.org/128.opus | opusdec - - | aplay -qfdat 

be sure you have installed opus packages


for listen OGG/Vorbis radio stream just write

ogg123 http://ai-radio.org

You need to have installed vorbis packages

Enjoy

1

mpg123 (http://www.mpg123.org/)

it's in the universe repositories, supports playlists and streaming from web-sources. When startet with -C you can also skip tracks in playlist etc. edit: not sure about ogg support.


music123

A command-line shell for programs like mpg123 and ogg123, music123 plays a variety of sound files using a mpg123/ogg123-like interface. With all the Recommends installed, music123 plays wav, mp3 and ogg files. By simply changing the config file, music123 can play any sound file you have a player for.

(If you install a recent version of vorbis-tools, music123 will handle Ogg Flac and Ogg Speex files too.)

1

For single file, check aplay, play, and paplay (for Pulseaudio only).

  • Should point out this answer is better from point of view paplay is installed by default. – WinEunuuchs2Unix Oct 25 '18 at 2:12
0

cmus

Plugins Input: Ogg Vorbis, MP3, FLAC, Musepack, WavPack, WAV, AAC, MP4, and everything supported by ffmpeg (WMA, APE, MKA, TTA, SHN, ...) and libmodplug Output: PulseAudio, ALSA, OSS, RoarAudio, libao, aRts, Sun, and WaveOut (Windows)

http://cmus.sourceforge.net/#features

0

I've used mp3blaster in the past. It supports Playlists, Groups, Repeat, Search. Not many special features.

  • any features worth mentioning? – type Jul 4 '11 at 21:44
  • 1
    Playlists, Groups, Repeat, Search. Not many special features. – RobinJ Jul 4 '11 at 21:48
0

Following on from the excellent shell pipeline answer given by @artem here's an mp3 version that I've just worked out:

URL=http://direct.fipradio.fr/live/fip-midfi.mp3
wget -qO- $URL | lame --quiet --decode --mp3input - - | pacat

(if you're not using pulseaudio, just swap the pacat for aplay)

protected by fossfreedom Jul 6 '15 at 12:20

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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