Importing metadata for ripped audio tracks

It's easy to import tracks from audio CDs using Rhytmbox or Clementine, but how do I import the metadata that goes along with each track? Specifically, I would like to automatically assign the song's title, album, artist, and genre to each track. How is that done in Ubuntu?