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?
For wav you can use
aplay
. For mp3 you can usempg123
.If you already have ffmpeg installed (you should have ffmpeg installed default with ubuntu), try:
I usually just do
mplayer foo.mp3
to play audio from the command line.The
play
command from thesox
package will play any file format supported bysox
To install
sox
open terminal and run:To use
play
command:Use
man sox
for more informationreference here
Not sure if your server will support it, but VLC also has a command line version that can play (with the right packages) MP3 files:
The 'n' in front of 'vlc' invokes the ncurses interface which is for the command line. This allows you to play multiple files, pause and control the files being played.
And additionally you can use
nvlc --random /path/to/your/music/folder
to play random songs from a Music folder.Or use
cvlc
instead ofnvlc
, for even minimal interaction.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.ffplay has -loglevel quiet, so no need to redirect output to the platform-specific /dev/null. So, building on others' answers,
Try
ffplay -formats
, see https://www.ffmpeg.org/ffplay.html.You told you have audacious installed. You can play audio file in command line by
audacious -Hq file
.mpv is a descendant of mplayer, which mlevin mentions. Many of the old command line switches still work, but some of the keyboard shortcuts have changed.
It also has the ability to "play" folders (by queuing all media files contained within).
Using smplayer to play audio .m4a files
This is SMPlayer v. 0.8.6 running on Linux.
NOTE: No interface displayed. It just play all the audio files in the folder.