- Home /
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.
Answer by belamessex · Mar 29, 2016 at 04:09 PM
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.
@belamessex That's genius! I love how my $$anonymous$$d likes to over think the possible. Well done! In the mean time, I'll check out FTL. I own it - just some how never got around to playing it.
Answer by Sanderso3n · Mar 23, 2020 at 11:30 AM
For a crossfade, you add an audio transition between two adjacent audio clips on the same track yourtexasbenefits
Answer by harshkhanwani · Dec 28, 2021 at 12:44 PM
. It would just transition into the new song for a set period of time. amazon benefits hronestop