Saturday, May 15, 2010

Make MPlayer use ALSA as the default audio driver

Make MPlayer use ALSA as the default audio driver

MPlayer can write decoded audio to many audio drivers. To get a list of output audio drivers supported on your machine execute the following command.

$ mplayer -ao help

Among the choices listed I prefer to use ALSA(Advanced Linux Sound Architecture). The -ao switch allows us to specify ALSA as the output audio driver to be used by MPlayer. An example usage is provided below:

$ mplayer -ao alsa linux_can.mp3

Specifying the -ao switch all the time can be a pain in the neck. This problem can be solved by copying the file /etc/mplayer.conf to ~/.mplayer/config. MPlayer reads this file on startup and initializes itself based on the settings provided in the file. In the file, the ao configuration value can be found under audio settings section. Uncomment the line and set the value for ao as alsa. The edited line should look like the one shown below:

# Specify default audio driver (see -ao help for a list).
ao=alsa

Now MPlayer will use ALSA on every invocation.

Author: mwnn <mwnnlin AT gmail DOT com>

HTML generated by org-mode 6.33x in emacs 23

No comments:

Post a Comment