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.?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Install vorbis-tools (
sudo apt-get install vorbis-tools) to get
$ ogg123 -v example.ogg Audio Device: Advanced Linux Sound Architecture (ALSA) output Author: Bill Currie <email@example.com>/Kevin Cody, Jr. <firstname.lastname@example.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.
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.
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.
How to play a single sound file:
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.
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
You need to have installed vorbis packages
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.
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.)
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)
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