Mix/Transition audio at any given moment?

Hi everyone!

I’m going to ask this the best I can as this seems like a pretty tough question/topic. Would it be possible (through Unity) to mix and transition two audio samples flawlessly? For example, your intro/main music is playing a classical piano song, then when the main player character hits a power up the song suddenly has a more vibrant/modern sound to it without there being any gaps or difference in musical notes being played. It would just transition into the new song for a set period of time (while the powerup is active/lasts). Is this even possible in Unity? Or, would you be looking at having to build your own engine for a listener of sorts that would mix/insert the audio at the right moment?

As I said, I know this maybe a tough one. If it’s kind of a crazy idea - I completely understand. The original/classical idea would be just to transition into a completely different music sample once a “powerup” is activated.

What this sounds like is a need for two tracks. One with your piano and another with the more vibrant track. You would add a function to your power up script that could bring in the vibrant track and overlay it on top of the already playing piano track. To keep timing correct, both tracks will always need to be playing. Then you would fade in / fade out volume to bring in your overlay. Faster Than Light does this really well with battle sequences. check it out for inspiration.

For a crossfade, you add an audio transition between two adjacent audio clips on the same track yourtexasbenefits

. It would just transition into the new song for a set period of time. amazon benefits