But, now using a single command (in your Terminal of course), you can install almost all of the popular proprietary codes which makes the above process a hell lot easier. So open your terminal and issue the following command,
sudo apt-get install ubuntu-restricted-extras
When asked for the password, give your user password and make sure you have administrative privileges (if you're using the user account that was created when installing Ubuntu, then you have those privileges by default).
So after installing this, you'll be able to play not only mp3, DVD, or other major file formats, but the above command will also install Microsoft fonts (be aware that, if I'm not mistaken, Microsoft does not allow you to use their fonts other than Windows), Java run-time files, Flash support, and many others as well.