Since Hardy I have had numerous issues with the audio on ubuntu. Apparently since Hardy the PulseAudio driver was being used and this created a whole host of compatibility issues. While some programs worked fine, others did not. Since I could see no benefit from Pulse I decided the easiest thing to do would be to remove Pulse entirely.
First, we need to remove the pulseaudio package, open a terminal and type:
$sudo apt-get remove pulseaudio
$sudo mv /etc/X11/Xsession.d/70pulseaudio /etc/X11/Xsession.d/70pulseaudio.bak
$sudo apt-get install esound
Now we need to setup Gnome Sound preferences:
1. Open System > Preferences > Sound:
Make sure everything is set to "Autodetect" (as in the screenshot) and set Sound Capture to "ALSA".
2. Open System > Preferences > Sessions:
Uncheck "PulseAudio Session Management"
Finally, restart the computer and everything should be working fine.