Contrary to what you may have read, encoding the sound in Virtualdub is a Bad Thing. It totally depends upon what you're trying to encode as to how you should extract the audio, but if it's from an AVI or MPG, then Virtualdub can extract it for you ('Save Wav').
Then simply encode the audio...