MOC — Console Audio Player for Linux

[ Tuesday, 15 May 2007, Roman ]

MOC is a console-based (build on ncurses library) audio player for Linux/BSD. It’s very easy to use, fast and functional so basically it has all the features of a decent player except for a fancy GUI. What is more — it takes a fraction of system resources consumed by most popular GUI players but still plays all popular formats „out-of-the-box”.

Author: Roman Tworkowski

Installation

Installing MOC is trivial. You can either download the sources, compile them and run or get a package specific to your distribution of choice and install it this way.

If you are using Debian or Ubuntu you can use these repositories:

deb http://www.lxtec.de/debarchiv unstable main
deb-src http://www.lxtec.de/debarchiv unstable main

Even though MOC is available in the default repos, it’s better to use those from lxtec.de since they are updated more frequently. After adding the lines above to /etc/apt/sources.list file you should run aptitude update && aptitude install moc to get the latest version from the repo.

If you are a hardcore player, use the MOC Subversion repository svn://daper.net/moc/trunk to get the creeping edge version of software.

Configuration

In the first place, MOC doesn’t require any special configuration. Still if you would like to play with the options feel free to copy the example config file from /usr/share/doc/moc/examples/ to your home folder in ~/.moc. Easy way to do it is by using this shell command: zcat /usr/share/doc/moc/examples/config.example.gz > ~/.moc/config. Then just edit the file manually with your most hated editor like vim. The options are a no-brainer so I won’t continue explaining them here. Consult the manual if you encounter any problems.

Using MOC

Let’s switch to the most important part of this article — how to actually use play music with MOC :). First run the program with mocp command. A window with your file system on the left should appear. The right side is reserved for the playlist. Now you can:

  • ENTER – switch to a folder, start playing the song, etc
  • ‘o’ – play URL (for instance some Internet radio)
  • ‘p’ or space bar – pause playing
  • ’s’ – stop playing
  • ‘l’ – switch between one and two-column view
  • ‘a’ – add current file to the playlist
  • ‘A’ – add current folder (recursively) to the playlist
  • ‘C’ – clear the playlist
  • ‘q’ – turn the console interface off (MOC server is still running and you can come back by entering mocp again)
  • ‘Q’ – hard power-off MOC

MOC can be also manipulated when the console interface is switched off. Here are some commands that may be useful for that:

  • ‘mocp -S’ – run the MOC server
  • ‘mocp -p’ – start playing the playlist
  • ‘mocp -f’ – switch to the next track on the playlist
  • ‘mocp -r’ – switch to the previous track on the playlist
  • ‘mocp -s’ – stop playing
  • ‘mocp -P’ – pause playing
  • ‘mocp -U’ – resume playing
  • ‘mocp -x’ – kill the server

More options can be obviously found in the MOC manual by entering man mocp.

moc audio player
Pic.1 MOC in action

MOC-specific features

MOC may be a bit different than any other audio player you know. These differences are in plus in my opinion ;-).

First, after when you select a song from a folder, MOC will keep playing the next song in the same folder when the selected one is over.
Secondly, MOC automatically remembers the playlist on exit and reads it when you next time run it.
Third, thanks to pre-caching system, there are no annoying breaks between the played tracks. It is especially noticeable when playing an audio CD.

Final tips

Finally I have a few tips from an experienced MOC user that may help you enjoy using MOC even more ;-).

Yes, it’s themeable too! The default MOC theme is… well pretty disgusting. For black terminals and those with transparency on the ‘transparent-background’ theme looks much better. You can set it in ~/.moc/config. If none of the themes fits your needs, no problem! Just download one from somewhere in the Internet and set it to default in the config file. Some MOC themes are located in /usr/share/moc/themes.

In case you don’t need another window on your crowded desktop, you can use ‘q’ to turn the MOC interface off and then run it again if you need the control. The tracks will keep playing anyway thanks to the build-in sound server.

I hope with this little article I made you want MOC on your desktop. If so, please feel free to leave a comment about your experience with MOC.

More on MOC

Subscribe to RSS feed for this article!

8 Comments

fold this thread Livio  Tuesday, 15 May 2007 o godz. 8:14 pm #  Add karma Subtract karma  +0

There’s MPD and ncmpc, so why make another console program ;) ?
PS: I know, to have an alternative :) .

 
fold this thread Tim  Wednesday, 16 May 2007 o godz. 2:18 am #  Add karma Subtract karma  +0
 
fold this thread spyro_boy  Wednesday, 16 May 2007 o godz. 1:47 pm #  Add karma Subtract karma  +0

Interesting. I’ve been looking for a non-server/client based CLI player with an ncurses UI. :]

MPD+NCMPC is my current combo and I love it but sometimes I download music from Frostwire and I want to quickly review it before I send it into my music directory (so MPD will scan it), so this works just great. :]

Great find.

 
fold this thread Adam  Wednesday, 16 May 2007 o godz. 2:59 pm #  Add karma Subtract karma  +0

And there’s still mp3blaster, somehow forgotten these days.

 
fold this thread michuk  Wednesday, 16 May 2007 o godz. 3:29 pm #  Add karma Subtract karma  +0

And there’s still mp3blaster, somehow forgotten these days.

I used mp3blaster a lot before switching to MOC. The reasons I switched are actually well described in this article — it’s more intuitive and handy to use. But mp3blaster is a very nice project as well.

 
fold this thread Henk  Wednesday, 23 May 2007 o godz. 11:31 am #  Add karma Subtract karma  +0

Sounds stupid maybe, but can i use it on MacosX as well? I am so bored with iTunes…

 
fold this thread elijah  Monday, 28 January 2008 o godz. 11:07 pm #  Add karma Subtract karma  +0

great find, i like it very much so far! just have to find out how to play shuffle the playlist

 
fold this thread vesama  Thursday, 21 February 2008 o godz. 2:13 pm #  Add karma Subtract karma  +0

Sift+S if you didn’t figure it out allready.

 
Name (required)
E-mail (required - never shown publicly)
URI

Adjust field size: shrink | enlarge)

You can use simple HTML in your comments. Some examples are as follows:
  • A hyperlink: <a href="polishlinux.org">GNU/Linux for everyone!</a>,
  • Strong text: <strong>Strong text</strong>,
  • Italic text: <em>italic text</em>,
  • Strike: <strike>strike</strike>,
  • Code: <code>printf("hello world");</code>,
  • Block quote: <blockquote>Block quote</blockquote>

About the Author

Roman Tworkowski

Advertise on PolishLinux!

Partners

RSS: Comments

You can follow the comments to this article through a special channel RSS 2.0 .

Related articles: CLI

 more »

Related articles: Multimedia

 more »

PolishLinux Top Content

Select distros:

vs

Google Ads