I'm a frequent user of AllMusic.com, a wonderful specialized database full of musician bios, track listings and much more. One feature (similar services are available at ITunes and elsewhere) is the ability to browse/search for music by mood, genre, theme, instrument, etc. In other words metadata has been entered for each song title.
Now, word of a specific research project at Sun Microsystems that makes song recommendations by actually analyzing the audio. It's called "Search Inside the Music."
The [Sun] technology analyses features such as rhythm and beat strength to categorise the music. It then searches for files with similar attributes...Because the analysis is such a compute-intensive task, he [developer Paul Lamere] expects that users will acquire the data from a server or have it bundled with the song at the time of purchase. The analysis is further augmented by metadata concerning the tracks' genre
Music Information Retrieval is rapidly expanding area of IR research.
The VNUnet.com article: Sun unveils all-knowing music library, has more including a reminder that SITM is only a research project and at this point Sun has no plans to commercialize the technology. You can also listen to a presentation by Lemere about Music Information Retrieval here. Want to learn more about music IR? Here's a place to begin.