Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed Ubuntu 11.10 server.. so command line only.

I need to be able to play audio (.mp3 & .wav) files via the command line!

I've installed the MPD & Audacious packages... and copied some files to a location specified in the .conf file.

But what do I do to acutally play the .mp3 files??

Also, how can I confirm the AUDIO is working correctly?

share|improve this question
    
You want to play it from the 'server' speakers or you want to play it across the network? Two very different things. –  hbdgaf Mar 23 '12 at 12:17
    
Audio through jack output, not over network (initially). –  user51760 Mar 23 '12 at 15:20
    
You could try installing sox, then at the commandline it would be "play thisorthat.mp3" or "play ~/music/thisfolder/thisorthat.mp3" –  tufkab Jul 3 '13 at 22:12

4 Answers 4

For wav you can use aplay. For mp3 you can use mpg123.

share|improve this answer
    
Thanks for this... mpg123 worked perfectly. –  user51760 Mar 23 '12 at 15:09

I usually just do mplayer foo.mp3 to play audio from the command line.

share|improve this answer
    
Thanks, I'll install the mplayer package and test it. –  user51760 Mar 23 '12 at 15:20

You can test the sound quite simply: speaker-test -c6 (where -c6 indicates I want to test 6 channels for a 5.1 setup)

But for playing music, mpd is just a server.

It needs a frontend to tell it to do things. Check out mpc for a fairly basic command line player. There are of course many, many clients (including graphical ones you can connect over the network) so you can play around with those.

share|improve this answer
    
Excellent, thanks for the speaker-test.... worked great. I'll also check out mpc. –  user51760 Mar 23 '12 at 15:15

If you already have ffmpeg installed (you should have ffmpeg installed default with ubuntu), try:

ffplay example.mp3
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.