playing mp3 using mplayer
June 22, 2008
When you want to play mp3 files you will likely to use amarok, banshee, rythmbox etc.
but now I just discover that I can use mplayer for playing mp3. it just simple. so I just have to type this command in my console
jacobian@jacobian-HP:~/Music/michael buble – its time$ mplayer -loop 0 home.mp3
MPlayer 1.0rc2-4.2.3 (C) 2000-2007 MPlayer Team
CPU: AMD Turion(tm) 64 X2 Mobile Technology TL-56 (Family: 15, Model: 72, Stepping: 2)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing home.mp3.
Audio file file format detected.
==========================================================================
Forced audio codec: mad
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 160.0 kbit/11.34% (ratio: 20000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback…
Cannot sync MAD frame 227.0 (03:47.0) 1.4%
Cannot sync MAD frame
Cannot sync MAD frame 227.0 (03:47.0) 1.4%
A: 226.7 (03:46.6) of 227.0 (03:47.0) 1.4%
Playing home.mp3.
Audio file file format detected.
==========================================================================
Forced audio codec: mad
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 160.0 kbit/11.34% (ratio: 20000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback…
Cannot sync MAD frame 227.0 (03:47.0) 1.4%
Cannot sync MAD frame
Cannot sync MAD frame 227.0 (03:47.0) 1.4%
A: 226.7 (03:46.6) of 227.0 (03:47.0) 1.4%
Playing home.mp3.
Audio file file format detected.
==========================================================================
Forced audio codec: mad
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 160.0 kbit/11.34% (ratio: 20000->176400)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback…
A: 7.1 (07.0) of 227.0 (03:47.0) 1.4%
the “-loop 0″ option will play the file over and over again.
Well I hope you like using mplayer to play your mp3 files.





Just visiting your blog.
Very nice and informative.
Yes, MPlayer are very nice for mp3. When I am in “Music Mode” I use other players with extensive album tag and so on support, but when I am working or doing other things I prefer MPlayer. One of the very good things is that it uses (almost) no resources and does not bother with anything but playing.
I mostly work on win2k and there it works like a charm. It also support keys (pause, next, prev, scan) and so on.
A nice way is to make playlists and play by i.e.
mplayer -loop 0 -playlist album.m3uIf you are in a directory of mp3 files you can pipe them to mplayer. On Windows it would be
mplayer dir *.mp3.This will result in mplayer playing all mp3 files in directory. Keyboard controls like next / > are working now as well.
Easiest way to create playlists are by commandline, ie: on M$windows
DIR *.mp3 /A-D/B/S/ON > playlist.m3uwill add all files in current and all subfolders to playlist.m3u. Similar is just as easy on *nix.Keyboard control on MPlayer in commandline mode are (among others)
Seek backward/forward 10 seconds.
up and down
Seek forward/backward 1 minute.
pgup and pgdown
Seek forward/backward 10 minutes.
[ and ]
Decrease/increase current playback speed by 10%.
{ and }
Halve/double current playback speed.
backspace
Reset playback speed to normal.
Go backward/forward in the playlist.
ENTER
Go forward in the playlist, even over the end.
HOME and END
next/previous playtree entry in the parent list
INS and DEL (ASX playlist only)
next/previous alternative source.
p / SPACE
Pause (pressing again unpauses).
.
Step forward. Pressing once will pause movie, every conâ€
secutive press will play one frame and then go into pause
mode again (any other key unpauses).
q / ESC
Stop playing and quit.
U
Stop playing (and quit if -idle is not used).
/ and *
Decrease/increase volume.
9 and 0
Decrease/increase volume.
( and )
Adjust audio balance in favor of left/right channel.
m
Mute sound.
o
Toggle OSD states: none / seek / seek + timer / seek +
timer + total time.
I
Show filename on the OSD.
(The following keys are valid if you have a keyboard with multimedia keys.)
PAUSE
Pause.
STOP
Stop playing and quit.
PREVIOUS and NEXT
Seek backward/forward 1 minute.
Keys can be changed in MPlayer-xxx/mplayer/input.conf
In *nix environment pipe is a good way to control MPlayer as well:
slave
So ie, step #1:
mkfifo /home/jet/.mplayer/pipeThen you can do ie, step #2:
echo "loadfile Led_Zeppelin-01-Black_Dog.mp3 1" > /home/jet/.mplayer/pipe(1 means que, 0 for immediate play)Have tried to get this to work on win2k as well (with GnuWin32, and UWIN) but no luck…
… hope some useful information, and not to long comment…
forgot example x:
find /home/music/Nick_Cave/studio/ -name "*.mp3" -print > nick_cave.m3uIt’s the first time I comment here and I must say you provide genuine, and quality information for other bloggers! Good job.
p.s. You have a very good template . Where did you find it?
Hi! I was surfing and found your blog post… nice! I love your blog.
Cheers! Sandra. R.