Hi All,
I’m having a bit of programmers block and need to some advice.
I’ve been trying to “copy” the base functionality of the FMOD Engine Designer. www.fmod.org which is essentialy this:
-
Lay out 8 - 10 audio clips, over lapping the ends of each clip (only two clips can overlap) over a span of 0 - 1… Clip 1 starts at 0.06 and ends at 0.09, Clip 2 starts at 0.08 and ends at 0.1… and so on.
-
Convert RPM (Revs per minute) into a number from 0 - 1 with 1 being full rev’s and 0 being no rev’s.
-
Take the converted RPM and figure out which two clips should be playing based on where they are located in the 0 - 1 span.
-
Adjust pitch of both clips 0.5f + Converted RPM = something between 0.5f and 1.5f
-
Adjust volume based on a sort of cross-fade, the clip that is nearing the end of the pitch range gets quieter and the other gets louder.
So… if you are still following, great My issue is that I don’t think I am giving my cross-fade enough time to completely go down to 0 before I switch out the clip with a new one.
I just need some advice on what option I should take and their possible performance issues:
A) Create as many audio sources as there are clip and have them continuously play and change the volumes (so they will always Lerp to 0 when they are not supposed to be playing
B) Create the audio sources as needed and delete them once they are Lerped to 0
C) Anyone got any ideas?