dcsimg

Command Line Audio: Simple as mpg123

Your mileage may vary with mpg123 but your MP3 listening enjoyment never will.

Did you ever want a little background music with your daily grind but either you didn’t want to (or couldn’t) fire up something graphical to use? That’s where mpg123 comes to your rescue. Mpg123 is a fast console MPEG audio player and decoder library. If you’re about to click on to another story because you think that a command line music playing application is devoid of features or functions, you’re going to miss out on one of the coolest and most versatile MP3 applications you’ve ever seen.

Those of you who work most of your 50-hour plus weeks at the command line deserve the same multimedia enjoyment that your GUI-tethered coworkers enjoy. Applications such as mpg123 give you the opportunity to get real work done and have a little fun while you do.

The Basics

It’s simple to install mpg123. You only need simple typing skills to install this command line gem.

$ sudo apt-get install mpg123

or,

$ sudo yum install mpg123

For purists or those less fortunates who have no packaged mpg123 version, you can download the source code is at http://sourceforge.net/projects/mpg123/.

Taking mpg123 for a Test Drive

Though mpg123 is small in stature, it could take 30 minutes or more to install it. It takes so long because, during the installation and setup process, the program automatically downloads sample podcasts into your home directory under a new directory named POD. Under that directory you’ll see the following directories: Linux, LINUX and Privacy. In each of those directories, you have directories that are home to three specific podcasts: The Privacy Podcast, The Linux Link and LUG Radio. For the purposes of this article, I chose the Privacy Podcast, by Aaron Titus, titled “When Breaches Go Unreported” due to its excellent and serious content. You should definitely listen to this one for your own edification.

To play one of the downloaded podcasts or a music file that you’ve purchased legally, summon mpg123 at the command line and use the -C switch to invoke mpg123′s full control complement.

$ mpg123 -vC POD/Privacy/Privacy\ Podcast/privacy-2007-10-22-56442.mp3

High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.12.1; written and copyright by Michael Hipp and others
        free software (LGPL/GPL) without any warranty but with best wishes
Decoder: SSE

Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: privacy-2007-10-22-56442.mp3 ...
Title:   When Breaches Go Unreported     Artist: Aaron Titus
Comment: Join Aaron Titus and explore common threats to your identity, and practical advice on how to make your identity more secure. www.aarontitus.net/privacy/
Album:   The Privacy Podcast
Year:    2007                            Genre:  Privacy
MPEG 1.0, Layer: III, Freq: 44100, mode: Stereo, modext: 0, BPF : 418
Channels: 2, copyright: No, original: No, CRC: No, emphasis: 0.
Bitrate: 128 kbit/s Extension value: 0
Frame#   768 [15040], Time: 00:20.06 [06:32.88], RVA:   off, Vol: 100(100)

The podcast begins to play for you. This one is just under seven minutes in length. The ‘-v’ switch provides a verbose output that shows you the Channel information, bitrate, counter and volume settings. To see mpg123′s controls, type ‘h’ during playback. Doing so will show the menu of available controls displayed below.

 -= terminal control keys =-
[s]     or [ ] interrupt/restart playback (i.e. '(un)pause')
[f]     next track
[d]     previous track
[b]     back to beginning of track
[p]     loop around current position (like a damaged audio CD;-)
[.]     forward
[,]     rewind
[:]     fast forward
[;]     fast rewind
[>]     fine forward
[<]     fine rewind
[+]     volume up
[-]     volume down
[r]     RVA switch
[v]     verbose switch
[l]     list current playlist, indicating current track there
[t]     display tag info (again)
[m]     print MPEG header info (again)
[h]     this help
[q]     quit
[c]     or [C] pitch up (small step, big step)
[x]     or [X] pitch down (small step, big step)
[w]     reset pitch to zero

If you have a directory that contains your favorite songs, you can play them all by issuing the mpg123 command with a wildcard setting.

$ mpg123 -vC *.mp3

Remote Access

If you must connect to your MP3 library remotely, don’t despair; you can listen as if you had direct access to the system console. From your local system, ssh to the remote system and issue the mpg123 command to enjoy your audio gold just as you would from the console. This feature comes in handy for those of you who can connect remotely to a home-based Linux system that has all your MP3s, leaving your work computer untouched by any “foreign” files that could score you a reprimand (or worse) from those who dispense your paycheck.

The mpg123 project maintainers provide regular updates though the documentation could use some help. Your best source for information on it is through its man page. You can get a lot of mileage out of mpg123 but beyond the basics, you’re on your own. For those of you so inclined, contact the developers to enhance and expand the documentation for this incredibly simple, fast and flexible utility.

Comments on "Command Line Audio: Simple as mpg123"

Although internet websites we backlink to beneath are considerably not connected to ours, we really feel they may be basically really worth a go by way of, so possess a look.

We came across a cool web page that you simply might take pleasure in. Take a search when you want.

The information mentioned in the post are several of the very best accessible.

Here are a few of the websites we suggest for our visitors.

Usually posts some extremely fascinating stuff like this. If you are new to this site.

Precisely what I was looking for, thankyou for posting.

The time to study or stop by the material or web pages we’ve linked to beneath.

Here are some links to web pages that we link to since we consider they’re really worth visiting.

Here is a great Weblog You may Find Interesting that we encourage you to visit.

One of our visitors recently suggested the following website.

You may have made some good points there. I checked online for more
information about the issue and found most people should
go as well as your views on this page.

Also visit my web site :: AnissaSPicha

Below you?ll come across the link to some web pages that we assume it is best to visit.

Although internet sites we backlink to beneath are considerably not connected to ours, we feel they’re actually worth a go via, so possess a look.

One of our visitors just lately proposed the following website.

We prefer to honor lots of other internet internet sites around the net, even when they aren?t linked to us, by linking to them. Beneath are some webpages worth checking out.

Although web-sites we backlink to below are considerably not connected to ours, we really feel they may be in fact really worth a go through, so possess a look.

Very handful of web-sites that come about to become detailed below, from our point of view are undoubtedly nicely worth checking out.

Every after in a although we pick blogs that we study. Listed below are the newest internet sites that we decide on.

Just beneath, are several completely not associated web sites to ours, nevertheless, they are surely worth going over.

Please pay a visit to the web sites we stick to, like this 1, as it represents our picks through the web.

The data mentioned inside the write-up are several of the most beneficial accessible.

Here is a good Blog You might Discover Exciting that we encourage you to visit.

Here are some links to web sites that we link to simply because we assume they are worth visiting.

One of our visitors lately suggested the following website.

We prefer to honor quite a few other web web pages around the internet, even though they aren?t linked to us, by linking to them. Underneath are some webpages really worth checking out.

We prefer to honor numerous other internet internet sites on the net, even if they aren?t linked to us, by linking to them. Beneath are some webpages worth checking out.

The time to study or visit the material or websites we’ve linked to beneath.

Although websites we backlink to beneath are considerably not associated to ours, we really feel they’re essentially worth a go by means of, so have a look.

Here is a superb Blog You may Find Exciting that we encourage you to visit.

Here are some hyperlinks to web-sites that we link to because we think they’re worth visiting.

Here are a few of the internet sites we recommend for our visitors.

We came across a cool website that you may enjoy. Take a appear for those who want.

Check below, are some entirely unrelated internet websites to ours, having said that, they’re most trustworthy sources that we use.

Below you will come across the link to some internet sites that we assume you need to visit.

Always a large fan of linking to bloggers that I like but do not get a whole lot of link adore from.

One of our guests just lately proposed the following website.

Usually posts some really interesting stuff like this. If you are new to this site.

We came across a cool web-site that you simply could enjoy. Take a appear if you want.

Just beneath, are a lot of completely not connected web pages to ours, however, they’re surely worth going over.

Here are a number of the web-sites we advise for our visitors.

We like to honor numerous other online websites around the web, even when they aren?t linked to us, by linking to them. Beneath are some webpages worth checking out.

Although internet websites we backlink to beneath are considerably not related to ours, we really feel they are essentially worth a go by, so possess a look.

Here is an excellent Weblog You may Discover Exciting that we encourage you to visit.

Usually posts some pretty fascinating stuff like this. If you?re new to this site.

Always a large fan of linking to bloggers that I appreciate but don?t get quite a bit of link enjoy from.

Here are some hyperlinks to web-sites that we link to since we believe they may be worth visiting.

Wonderful story, reckoned we could combine several unrelated data, nevertheless definitely really worth taking a appear, whoa did a single learn about Mid East has got extra problerms also.

Although web-sites we backlink to beneath are considerably not associated to ours, we feel they are actually really worth a go as a result of, so have a look.

Wonderful story, reckoned we could combine a number of unrelated data, nonetheless actually really worth taking a look, whoa did one understand about Mid East has got extra problerms at the same time.

Always a huge fan of linking to bloggers that I love but don?t get a good deal of link really like from.

Leave a Reply