Try the xfade~ abstraction
For this example to work properly, you must first download "Abstraction for mixing or crossfading two audio signals" and save it with the name xfade~.maxpat. Then you must ensure that your xfade~.maxpat file is in the Max search path, or you must save this example patch in the same folder as the xfade~.maxpat file and reopen it, so that this patch can find the xfade~ object.