How to play music in terminal?











up vote
11
down vote

favorite
3












I want a command line to play a specific music file in terminal (or script) from my hard-disk. It would be better to do it without installing extra packages.










share|improve this question
























  • MoC (Music on Console) is another option worth exploring. Here's a guide to set this up.
    – legends2k
    Feb 27 '14 at 16:58















up vote
11
down vote

favorite
3












I want a command line to play a specific music file in terminal (or script) from my hard-disk. It would be better to do it without installing extra packages.










share|improve this question
























  • MoC (Music on Console) is another option worth exploring. Here's a guide to set this up.
    – legends2k
    Feb 27 '14 at 16:58













up vote
11
down vote

favorite
3









up vote
11
down vote

favorite
3






3





I want a command line to play a specific music file in terminal (or script) from my hard-disk. It would be better to do it without installing extra packages.










share|improve this question















I want a command line to play a specific music file in terminal (or script) from my hard-disk. It would be better to do it without installing extra packages.







command-line






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 3 '14 at 5:13









Braiam

51.2k20134219




51.2k20134219










asked Nov 25 '11 at 14:41









Black Block

2,393174064




2,393174064












  • MoC (Music on Console) is another option worth exploring. Here's a guide to set this up.
    – legends2k
    Feb 27 '14 at 16:58


















  • MoC (Music on Console) is another option worth exploring. Here's a guide to set this up.
    – legends2k
    Feb 27 '14 at 16:58
















MoC (Music on Console) is another option worth exploring. Here's a guide to set this up.
– legends2k
Feb 27 '14 at 16:58




MoC (Music on Console) is another option worth exploring. Here's a guide to set this up.
– legends2k
Feb 27 '14 at 16:58










4 Answers
4






active

oldest

votes

















up vote
8
down vote



accepted










I think the default installation has no way to play audio files from command line, other than using aplay on WAV files (aplay also support other formats, but the man page is not clear in this regard).



To play, for example, MP3 files, you need restricted codecs available through ubuntu-restricted-extras, and a player like mplayer or cvlc, but there are many other: see What Media Players Are there? where text based and GUI based audio players are listed.






share|improve this answer























  • ubuntu-restricted-extras is considered as default in Ubuntu(as all have to install it with installation or after)i always install them when setting-up Ubuntu.
    – Black Block
    Nov 25 '11 at 18:02










  • The missed Sox!
    – Vorac
    Nov 25 '13 at 12:45












  • APlay does not play m4a files... or it does, but it sounds like a dialup connection.
    – Akiva
    Apr 16 '14 at 7:18


















up vote
8
down vote













There are players such as cmus, mpg321, ogg123, etc.



enter image description here






share|improve this answer




























    up vote
    3
    down vote













    There are several text based Media Players which play in the Terminal, which are not mentioned in "What Media Players Are There?" ---but they will all involve some download.



    (You do say "It would be better to do it without installing extra packages" but you do not say it is a definite no-no)



    Have a look at http://kmandla.wikispaces.com/search/view/music.



    Worthy of special mention are moc and cmus.






    share|improve this answer





















    • A very good collection, thanks.
      – Black Block
      Nov 25 '11 at 17:57


















    up vote
    3
    down vote













    Try sudo apt-get install mocand then mocp
    in a new terminal window.



    This will let you play the selected audio from the terminal.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f82605%2fhow-to-play-music-in-terminal%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      8
      down vote



      accepted










      I think the default installation has no way to play audio files from command line, other than using aplay on WAV files (aplay also support other formats, but the man page is not clear in this regard).



      To play, for example, MP3 files, you need restricted codecs available through ubuntu-restricted-extras, and a player like mplayer or cvlc, but there are many other: see What Media Players Are there? where text based and GUI based audio players are listed.






      share|improve this answer























      • ubuntu-restricted-extras is considered as default in Ubuntu(as all have to install it with installation or after)i always install them when setting-up Ubuntu.
        – Black Block
        Nov 25 '11 at 18:02










      • The missed Sox!
        – Vorac
        Nov 25 '13 at 12:45












      • APlay does not play m4a files... or it does, but it sounds like a dialup connection.
        – Akiva
        Apr 16 '14 at 7:18















      up vote
      8
      down vote



      accepted










      I think the default installation has no way to play audio files from command line, other than using aplay on WAV files (aplay also support other formats, but the man page is not clear in this regard).



      To play, for example, MP3 files, you need restricted codecs available through ubuntu-restricted-extras, and a player like mplayer or cvlc, but there are many other: see What Media Players Are there? where text based and GUI based audio players are listed.






      share|improve this answer























      • ubuntu-restricted-extras is considered as default in Ubuntu(as all have to install it with installation or after)i always install them when setting-up Ubuntu.
        – Black Block
        Nov 25 '11 at 18:02










      • The missed Sox!
        – Vorac
        Nov 25 '13 at 12:45












      • APlay does not play m4a files... or it does, but it sounds like a dialup connection.
        – Akiva
        Apr 16 '14 at 7:18













      up vote
      8
      down vote



      accepted







      up vote
      8
      down vote



      accepted






      I think the default installation has no way to play audio files from command line, other than using aplay on WAV files (aplay also support other formats, but the man page is not clear in this regard).



      To play, for example, MP3 files, you need restricted codecs available through ubuntu-restricted-extras, and a player like mplayer or cvlc, but there are many other: see What Media Players Are there? where text based and GUI based audio players are listed.






      share|improve this answer














      I think the default installation has no way to play audio files from command line, other than using aplay on WAV files (aplay also support other formats, but the man page is not clear in this regard).



      To play, for example, MP3 files, you need restricted codecs available through ubuntu-restricted-extras, and a player like mplayer or cvlc, but there are many other: see What Media Players Are there? where text based and GUI based audio players are listed.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 13 '17 at 12:24









      Community

      1




      1










      answered Nov 25 '11 at 14:56









      enzotib

      62.2k6131153




      62.2k6131153












      • ubuntu-restricted-extras is considered as default in Ubuntu(as all have to install it with installation or after)i always install them when setting-up Ubuntu.
        – Black Block
        Nov 25 '11 at 18:02










      • The missed Sox!
        – Vorac
        Nov 25 '13 at 12:45












      • APlay does not play m4a files... or it does, but it sounds like a dialup connection.
        – Akiva
        Apr 16 '14 at 7:18


















      • ubuntu-restricted-extras is considered as default in Ubuntu(as all have to install it with installation or after)i always install them when setting-up Ubuntu.
        – Black Block
        Nov 25 '11 at 18:02










      • The missed Sox!
        – Vorac
        Nov 25 '13 at 12:45












      • APlay does not play m4a files... or it does, but it sounds like a dialup connection.
        – Akiva
        Apr 16 '14 at 7:18
















      ubuntu-restricted-extras is considered as default in Ubuntu(as all have to install it with installation or after)i always install them when setting-up Ubuntu.
      – Black Block
      Nov 25 '11 at 18:02




      ubuntu-restricted-extras is considered as default in Ubuntu(as all have to install it with installation or after)i always install them when setting-up Ubuntu.
      – Black Block
      Nov 25 '11 at 18:02












      The missed Sox!
      – Vorac
      Nov 25 '13 at 12:45






      The missed Sox!
      – Vorac
      Nov 25 '13 at 12:45














      APlay does not play m4a files... or it does, but it sounds like a dialup connection.
      – Akiva
      Apr 16 '14 at 7:18




      APlay does not play m4a files... or it does, but it sounds like a dialup connection.
      – Akiva
      Apr 16 '14 at 7:18












      up vote
      8
      down vote













      There are players such as cmus, mpg321, ogg123, etc.



      enter image description here






      share|improve this answer

























        up vote
        8
        down vote













        There are players such as cmus, mpg321, ogg123, etc.



        enter image description here






        share|improve this answer























          up vote
          8
          down vote










          up vote
          8
          down vote









          There are players such as cmus, mpg321, ogg123, etc.



          enter image description here






          share|improve this answer












          There are players such as cmus, mpg321, ogg123, etc.



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 25 '11 at 18:18









          Anonymous

          8,20452731




          8,20452731






















              up vote
              3
              down vote













              There are several text based Media Players which play in the Terminal, which are not mentioned in "What Media Players Are There?" ---but they will all involve some download.



              (You do say "It would be better to do it without installing extra packages" but you do not say it is a definite no-no)



              Have a look at http://kmandla.wikispaces.com/search/view/music.



              Worthy of special mention are moc and cmus.






              share|improve this answer





















              • A very good collection, thanks.
                – Black Block
                Nov 25 '11 at 17:57















              up vote
              3
              down vote













              There are several text based Media Players which play in the Terminal, which are not mentioned in "What Media Players Are There?" ---but they will all involve some download.



              (You do say "It would be better to do it without installing extra packages" but you do not say it is a definite no-no)



              Have a look at http://kmandla.wikispaces.com/search/view/music.



              Worthy of special mention are moc and cmus.






              share|improve this answer





















              • A very good collection, thanks.
                – Black Block
                Nov 25 '11 at 17:57













              up vote
              3
              down vote










              up vote
              3
              down vote









              There are several text based Media Players which play in the Terminal, which are not mentioned in "What Media Players Are There?" ---but they will all involve some download.



              (You do say "It would be better to do it without installing extra packages" but you do not say it is a definite no-no)



              Have a look at http://kmandla.wikispaces.com/search/view/music.



              Worthy of special mention are moc and cmus.






              share|improve this answer












              There are several text based Media Players which play in the Terminal, which are not mentioned in "What Media Players Are There?" ---but they will all involve some download.



              (You do say "It would be better to do it without installing extra packages" but you do not say it is a definite no-no)



              Have a look at http://kmandla.wikispaces.com/search/view/music.



              Worthy of special mention are moc and cmus.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 25 '11 at 16:19









              arochester

              1,99411114




              1,99411114












              • A very good collection, thanks.
                – Black Block
                Nov 25 '11 at 17:57


















              • A very good collection, thanks.
                – Black Block
                Nov 25 '11 at 17:57
















              A very good collection, thanks.
              – Black Block
              Nov 25 '11 at 17:57




              A very good collection, thanks.
              – Black Block
              Nov 25 '11 at 17:57










              up vote
              3
              down vote













              Try sudo apt-get install mocand then mocp
              in a new terminal window.



              This will let you play the selected audio from the terminal.






              share|improve this answer



























                up vote
                3
                down vote













                Try sudo apt-get install mocand then mocp
                in a new terminal window.



                This will let you play the selected audio from the terminal.






                share|improve this answer

























                  up vote
                  3
                  down vote










                  up vote
                  3
                  down vote









                  Try sudo apt-get install mocand then mocp
                  in a new terminal window.



                  This will let you play the selected audio from the terminal.






                  share|improve this answer














                  Try sudo apt-get install mocand then mocp
                  in a new terminal window.



                  This will let you play the selected audio from the terminal.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Sep 30 '15 at 18:24









                  kos

                  25.1k869118




                  25.1k869118










                  answered Sep 30 '15 at 9:23









                  Seshu Paturu

                  314




                  314






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f82605%2fhow-to-play-music-in-terminal%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Ellipse (mathématiques)

                      Quarter-circle Tiles

                      Mont Emei