Posted on

Ubuntu – No Audio When Playing Videos

I recently tried to play a video on Ubuntu 10.04, but got no audio because of missing a Windows Media Audio codec. My video player tried to automatically find a suitable plugin and failed. So here’s how I fixed it by hand.

Step One: Update mplayer

The version of mplayer that comes with Ubuntu is behind the times.
But that’s easy to fix.

    $ sudo add-apt-repository ppa:rvm/mplayer
    $ sudo apt-get update
    $ sudo apt-get upgrade mplayer

Bam. Done. Also why not install smplayer while you’re at it—has a much better interface in my opinion.

*Note:* If you prefer to use something else like vlc then upgrading may not be necessary. Check the documentation for your preferred movie player to see about its WMA support.

Step Two: Discover the DLL You Need

This is easy: just try playing the file from the command line.

Something like

    $ smplayer legitimate_copy_of_a_movie_i_totally_own.wmv

If you see a ton of output, and hear no audio, then you are missing a library. Thankfully (s)mplayer will tell you exactly what this library is called; just look in the output for the name of a `.dll` file mentioned in conjunction with audio.

Step Three: Add the DLL

Get on your favorite search engine, enter the DLL, and find a copy to download.

Whatever DLL you need, take it and put it in the directory `/usr/lib/codecs`. The directory probably does not exist, so create it first, of course. Video players will automatically look there for the DLLs they need.

After that, you should all be set. That’s how I was able to get audio out of Windows Media Player 9 files. Hope it helps you too.