Advertisement
Tech

Linux Command Line Audio Player Options - Mplayer, mpg123 and mp3blaster

Unlike Windows’ limited command prompt environment, Linux has a feature-filled command-line environment which can be used for everything from reading emails to watching videos. In this article, we’ll take a look at how you can listen to music on your Linux box using the command-line.

By Pranav Thadeshwar
Desk Tech
Reading time 3 min read
Word count 579
Linux Computing Linux multimedia
Linux Command Line Audio Player Options - Mplayer, mpg123 and mp3blaster
Advertisement
Quick Take

Unlike Windows’ limited command prompt environment, Linux has a feature-filled command-line environment which can be used for everything from reading emails to watching videos. In this article, we’ll take a look at how you can listen to music on your Linux box using the command-line.

On this page

Introduction

While not the most innovative thing to do, getting your Linux command-line to play music can be useful in many situations. Perhaps you have a less-capable PC which you want to use as a simple media player, or you do not want to install a GUI just to listen to music. These players are also very useful in situations like car computers which might not have a suitable display to control them. Whatever the need, there are a bunch of audio players for Linux which will play music without needing to run a fancy interface and use lots of resources.

mpg123

mpg123 is a fast command-line based audio player which works on most POSIX compliant operating systems, including Linux and UNIX. Since the audio decoder has been optimized using the Assembler programming language, it is probably the most resource-efficient audio player today. Here are a list of features advertised by mpg123:

Advertisement
  • Support for many platforms (many Unices, MacOSX, Windows) and audio subsystems
  • Simple but powerful control mode for frontends
  • Realtime control of efficient equalizer
  • Built-in terminal control keys
  • Support for gapless playback of mp3 files
  • Many audio data settings: resampling, choose channel, mono,
  • Really efficient with a growing number of assembler optimizations
  • Support for Relative Volume Adjustment / ReplayGain

To get mpg123 for your Linux distribution, look through your package manager’s repository. To use the application to play audio, just type: mpg123 “/path/to/audio/file/filename.mp3”

mp3blaster

mp3blaster is another command line player which plays multiple formats like MP3, Ogg Vorbis, wav and sid. The ace up its sleeve is its ability to compose a very flexible playlist. In the creator’s own words, “I also wondered why all mp3players had such plain playlist functionality! I like the ability to chuck a bunch of CD’s in a multi-CD cd player, and then play the CD’s in random order. In such a way that the cd player selects one of the five CD’s at random, and then plays the entire disc. This continues, until all discs have been played. No mp3 player could do this, so I decided to add it to mine. "

Advertisement

It has an ncurses interface which gives users the ability to interact and control the player while music is playing. mp3blaster can be installed in your Linux distribution by referring to its package manager. To run mp3blaster, type “mp3blaster” in the command-line, then control the player using the keys mentioned in the user interface itself.

mplayer

Although mplayer is a lot more than a command-line audio player, it works just as well as any other dedicated command-line audio player. It works on all major operating systems including UNIX, Linux and Windows. It supports the following audio file formats:

Advertisement
  • AAC
  • AC3
  • ALAC
  • AMR
  • FLAC
  • Intel Music Coder
  • Monkey’s Audio
  • MP3
  • Musepack
  • RealAudio
  • Shorten
  • Speex
  • Vorbis
  • WMA

Playing an audio file in mplayer is as simple as typing “mplayer /path/to/audio/file/song.mp3”. Various keyboard shortcuts are available to navigate and control the playback of files. Refer to mplayer’s documentation to find out more. mplayer will be available in your Linux distribution’s package manager. Please refer to your distribution’s documentation to install mplayer.

Final Words

Command-line audio players, while not having the fancy graphical interfaces of their GUI counterparts, are very useful in certain situations. These players shine on computers with less horsepower and specific purposes. For example, you could use an old computer with loads of storage space using multiple hard-disks and make it an audio player using one of these minimalistic players.

Advertisement
Keep Exploring

More from Tech

Filed under
Linux Computing
More topics
Linux multimedia
Advertisement