maybe examining the first x seconds of the song. if its average volume is higher than y fade in, else leave as is. also knowing the last bit of volume on the currently playing track, to know whether to fade out.
ive kept this post short, perhaps confusing.