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!

18 Comments

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

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

(Comments wont nest below this level)
 
fold this thread Tim  Wednesday, 16 May 2007 o godz. 2:18 am #  Add karma Subtract karma  +1
(Comments wont nest below this level)
 
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.

(Comments wont nest below this level)
 
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.

(Comments wont nest below this level)
 
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.

(Comments wont nest below this level)
 
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…

(Comments wont nest below this level)
 
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

(Comments wont nest below this level)
 
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.

(Comments wont nest below this level)
 
fold this thread Eugene Pickerel  Thursday, 26 July 2012 o godz. 1:37 pm #  Add karma Subtract karma  +0

Hello to every one, the contents existing at this site are genuinely amazing for people experience, well,
keep up the good work fellows.

(Comments wont nest below this level)
 
fold this thread Long Hairstyles  Tuesday, 5 February 2013 o godz. 2:44 pm #  Add karma Subtract karma  +0

Do you have a spam issue on this website; I also am a blogger, and I was wanting to know your situation; we have created
some nice procedures and we are looking to swap methods with other folks, please shoot me an email if interested.

(Comments wont nest below this level)
 
fold this thread Hannah  Friday, 18 October 2013 o godz. 1:04 am #  Add karma Subtract karma  +0

I don’t know if it’s just me or if perhaps everybody else encountering
problems with your blog. It appears like some of the written text on your content are running off the screen.
Can somebody else please provide feedback and let me know if this is happening to them as well?
This could be a problem with my internet browser because I’ve had this happen
previously. Kudos

(Comments wont nest below this level)
 
fold this thread CoD Ghosts Cheats  Friday, 18 October 2013 o godz. 11:58 am #  Add karma Subtract karma  +0

Woah! I’m really enjoying the template/theme of this website.
It’s simple, yet effective. A lot of times it’s difficult to get
that “perfect balance” between superb usability and visual appeal.
I must say you’ve done a excellent job with this. Also, the blog loads extremely
quick for me on Chrome. Exceptional Blog!

(Comments wont nest below this level)
 
fold this thread jak zalozyc bloga za darmo na onecie  Friday, 23 May 2014 o godz. 2:28 am #  Add karma Subtract karma  +0

Hi i am kavin, its my first time to commenting anywhere, when i read this
paragraph i thought i could also make comment due to this good article.

(Comments wont nest below this level)
 
fold this thread hack para criminal case cheat engine 6.2  Saturday, 24 May 2014 o godz. 1:43 pm #  Add karma Subtract karma  +0

The anniversary collection is now available on the PSN, which
includes the original game with the DLC including new roles
and maps to play in. Now that the dust has settled we see that those photographers who have survived the changes
in emphasis in the stock photography industry are those who have became an authority in their own specific subject area.
Inevitably feelings run deep amongst the over 50, trapped by their infamous history.

After a week of extensive research, he finally came up which has a working PSN
Code electrical generator that works really very good.
It is apparent that Sony’s security infrastructure, combined with a hacking group’s intent on showing how capable they are of breaking into
systems, is a recipe for disaster. Hulu Plus streaming quality also disappointed many users as per several forums where users discussed about its not so good
quality streaming on PS3 and other consoles. This option helps out with the driving out and burning a
little gas problem but you still have to wait and then have
a little plastic souvenir.

(Comments wont nest below this level)
 
fold this thread Margarette  Monday, 25 August 2014 o godz. 12:02 pm #  Add karma Subtract karma  +0

Paragraph writing is also a fun, if you be familiar with then you can write or
else it is complex to write.

(Comments wont nest below this level)
 
fold this thread massage green  Thursday, 4 September 2014 o godz. 2:49 am #  Add karma Subtract karma  +0

What’s up, I would like to subscribe for this webpage to get most recent updates, so where can i
do it please help out.

(Comments wont nest below this level)
 
fold this thread Free PSN Redeem Codes  Sunday, 7 September 2014 o godz. 2:17 pm #  Add karma Subtract karma  +0

You will learn how to brand yourself appropriately without spamming and how to attract customers from all over the world.

To know the real value of a card, all you need to do is to call the
number (too-free) at the printed on the back side of the card.
After all Christmas is around the corner and those toys always need
a million batteries, right.

(Comments wont nest below this level)
 
fold this thread nba2k14 locker code  Friday, 19 September 2014 o godz. 12:56 am #  Add karma Subtract karma  +0

Aw, this was an incredinly good post. Taking the time and actual
effort to produce a great article… but what can I say… I hesitate a whole lot and don’t manage to get anythingg done.

(Comments wont nest below this level)
 
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

New AdTaily ads!

Are you a film buff?

film buffs community, movie recommendations and reviews

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


Become our fan on Facebook!

PolishLinux.org on Facebook

Follow PolishLinux on Twitter!

Follow polishlinux on Twitter

Google Ads