Music fade

Is it possible to crossfade music?

For example you enter a building and music plays and when you exit the building the song fades to turn off.

You know some thing like that.