I'm wondering if there's a command I can install to play an audio file from the terminal, or if I can do it with Python or a different code? I just want to type a command, have it play a sound until the sound is finished, then return to the prompt. I don't want a GUI.


Yes you can do it with many commandline tools like mpg123, aplay , cvlc and mplayer:

But I suggest play:

For install it:

sudo apt install sox

And for playing special formats like mp3 you must install its libraries:

sudo apt install libsox-fmt-mp3

And for use it:

play music.mp3

If you want to use it with full libraries, you must install libsox-fmt-all package:

sudo apt install libsox-fmt-all
| improve this answer | |
  • 1
    ty very much :) That's exactly what I wanted – cheesits456 May 30 '17 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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