Rock Out with Your Console Out

Jun 11, 2012 By Rebecca Chapnik  inAudio/VideoHOW-TOsmusic Playing and managing your music in text mode.

Some of you probably have played audio files from the terminal withone-line commands, such as play, or even used the command line to opena playlist in a graphical music player. Command-line integration is oneof the many advantages of using Linux software. This is an introductionfor those who want the complete listening experience—browsing, managingand playing music—without leaving the text console.

Thanks to the Ncurses (New Curses) widget library, developers can designtext user interfaces (TUIs) to run in any terminal emulator. An Ncursesapplication interface is interactive and, depending on the application,can capture events from keystrokes as well as mouse movements andclicks. It looks and works much like a graphical user interface, exceptit's all ASCII—or perhaps ANSI, depending on your terminal. If you'veused GNU Midnight Commander, Lynx or Mutt, you're already familiarwith the splendors of Ncurses.

An intuitive interface, whether textual or graphical, is especiallyimportant in a media player. No one wants to sift through a long manpage or resort to Ctrl-c just to stop an annoying song fromplaying on repeat, and most users (I'm sure some exceptions exist amongLinux Journal readers) don't want to type out a series of commands justto ls the songs in an album's directory, decide which oneyou want to hear and play it, and thenplay asong in a different directory. If you've ever played music with a purelycommand-line application, such as SoX, you know what I'm talkingabout. Sure, a single command that plays a file is quite handy; thisarticle, however, focuses on TUI rather than CLI applications. For manytext-mode programs, Ncurses is the window (no pun intended) to usability.

Note to developers: if you want to write a console music player, takeadvantage of the Curses Development Kit (CDK), which includes severalready-made widgets, such as scrolling marquees and built-in file browsing.

Now, on to the music players!


Mp3blaster was the first console music player I ever used. That wasin 2007, by which time it already was a mature and full-featuredapplication. Its history actually dates back to 1997, before themainstream really had embraced the MP3 format, let alone the idea of anattractive interface for controlling command-line music playback. Backthen, it was humbly known as "Mp3player".

Despite the name, Mp3blaster supports several formats besidesMP3s. Currently, these include OGG, WAV and SID. Keep an eye out forFLAC support in the future, as it is on the to-do list in the latestsource tarball.

One nice feature of Mp3blaster is the top panel showing important keyboardshortcuts for playlist management. You can scroll through this list using

View the Original article

No comments:

Post a Comment

Thank You , For Immediate Assistance Plz Put Email Copy to