Results 1 to 10 of 10

Thread: How to play music from the command line

Threaded View

  1. #1
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan Norwich
    Beans
    2,326
    Distro
    Lubuntu 22.04 Jammy Jellyfish

    How to play music from the command line

    The information in this thread has been moved to https://help.ubuntu.com/community/Pl...romCommandLine


    A thread for discussion of the wiki page only can be found here http://ubuntuforums.org/showthread.php?t=2012415


    Thread closed.

    Some people like myself do not thrive on Library-type players and prefer players like xmms audacious or deadbeef and would rather even play their current discs/music files straight from the command-line; call it the Zen school of music-playing [as in pared down]


    This is a short howto for those people


    USING gnome-open-terminal or gnome-terminal



    so to get a great handy command-line music player [looks like a player and is independent from folders and other open terminals]



    1.
    Code:
     sudo apt-get-install gnome-open-terminal
    2. Open Music folder/Right-click/Choose Open In terminal

    3. enter
    Code:
    nvlc */./*


    or refine to cut out random txt/image files to
    Code:
    nvlc */./*flac *ape *wv *shn *aac *m4a *mp3
    and any other music extensions you have you can also simplify this with an alias see here


    there you go.... arrows for navigation


    PS



    a short video to illustrate



    also easy way to have hotkeys to pause/play and go to next track can be set in vlc global preferences and will work with nvlc too


    ================================================== ==============

    3 routes in detail




    I propose 3 routes here SoX which has many functions; NVLC which is part of the VLC package and Mplayer which can be used from the command line too




    1.
    First SoX is really marvelous usually described as the Swiss Army knife of sound processing programs it is perfect for our purpose here



    sudo apt-get install sox libsox-fmt-all


    say you have a bunch of flacs it will play them which a simple command


    Code:
    play * flac
    but with Sox you can add filters thus

    Code:
    play * flac bass +4 gain +2 reverb
    will add quite a bit of bass reverb and added volume

    for all options run
    Code:
    man SoX
    it accommodates a lot of formats

    AUDIO FILE FORMATS: 8svx aif aifc aiff aiffc al amb amr-nb amr-wb anb au avi avr awb cdda cdr cvs cvsd cvu dat dvms f32 f4 f64 f8 ffmpeg flac fssd gsm gsrt hcom htk ima ircam la lpc lpc10 lu m4a m4b maud mp2 mp3 mp4 mpg nist ogg prc raw s1 s16 s2 s24 s3 s32 s4 s8 sb sds sf sl smp snd sndfile sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 u32 u4 u8 ub ul uw vms voc vorbis vox wav wavpcm wmv wv wve xa
    PLAYLIST FORMATS: m3u pls
    CTRL+c gets you to the next track if you hit CTRL+c and hit c twice it stops play



    2.NVLC is simply superb as a command line player it looks quite nice for starters




    you summon it this way
    Code:
    nvlc */./*
    to enter every folder and play every file in turn. If you are in a single folder simply enter
    Code:
    nvlc *
    or
    Code:
    nvlc *.flac  or whichever extension you are playing
    and it can be used almost as well as the GUI version left and right arrows will move along your file as great speed

    keys "a" and "z" control up and down volume space bar to stop and start and info on your track with i

    h to find all your options


    ================================================== =======



    ================================================== =====

    3.
    Now neither SoX nor Nvlc can handle shorten which is a format that i favour and this is where Mplayer came in handy; and of course it can used for all formats handled by Mplayer and that is like NVLC a lot of formats

    even easier here go into the folder and then enter
    Code:
    mplayer *
    or add your extension if you only want one specific extension played ie
    Code:
    mplayer *.wv
    if you want to enter all the music subfolders in your Music folder and play all the music files with mplayer you can use this little code As is or as a script


    Code:
    for i in */
    do
      cd "$i"
    mplayer *
      cd ..
    done
    or even more simply
    Code:
    mplayer */./*
    will do the same


    Other Tips
    ==============================================

    TO PLAY A CUEFILE

    Code:
    nvlc name.cue


    ==============================================

    TO NAVIGATE ON NVLC AND MPLAYER

    Use top-bottom-left-right arrows


    see further up for info on hotkeys & alias script
    Last edited by Elfy; June 29th, 2012 at 09:26 AM. Reason: cuefile info
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community ie 50 brains are better than one
    Playing with Slackware too now ...
    ShanArt

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •