If you're experience bad sound with the default WINE package in Ubuntu and have Pulseaudio working, you should try the following WINE package (available in an Ubuntu PPA) which comes with built-in Pulseaudio support. This is especially useful if you use Spotify under Wine in Ubuntu.
Before using this PPA you must make sure you're not using the WINE PPA (because the WINE PPA always gets newer packages very fast and will overwrite the packages from the WINE with Pulseaudio PPA). Also, if you're already using the WINE PPA, after adding the PPA in this post you'll have to downgrade WINE (don't worry - the Pulseaudio WINE PPA gets updates too, just not as fast).
To add the WINE Pulseaudio PPA and install WINE with Pulseaudio support, paste the following line in a terminal (Ubuntu Karmic and Lucid only):
Update: the official Wine PPA now includes the Pulseaudio patch. Add it and upgrade Wine using the following commands:
Then go to Applications > WINE > Configure Wine, and under the Audio tab, select "PulseAudio Driver" under Sound Drivers.
sudo add-apt-repository ppa:neil-aldur/ppa
sudo apt-get update && sudo apt-get upgrade #I assume you already have wine installed
Update: the official Wine PPA now includes the Pulseaudio patch. Add it and upgrade Wine using the following commands:
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get upgrade
Then go to Applications > WINE > Configure Wine, and under the Audio tab, select "PulseAudio Driver" under Sound Drivers.
Special thanks to WebUpd8 reader
for the tip!