Creating Engine sound based on FMOD Engine Designer theory

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 :slight_smile: 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?

Answer: I had to create the audio sources for each clip at run-time otherwise there way a millisecond delay between playing the clips which made the engine sound like it was stuttering.

But I turn them on and off as needed.

What do you mean by “create the audio sources for each clip at run-time”? Is that instantiating them from audio prefabs?

I was adding the components to a single game object

argh. got it. thanks! Don’t suppose you know how to accurately control the pitch of a .wav sound in Unity without altering it’s speed?

If you are making aren’t making an iPhone or Android game you can use this http://www.squaretangle.com/FMODUnity.html, it works quite nicely.

I needed it for iPhone and the guys who created it aren’t working on an iPhone version just yet (apparently it’s in the pipeline though).

If you are after a nice engine sound, download FMOD Designer and check out how it works, it’s pretty easy to roll your own realistic sounding engine.

FMOD is here: http://www.fmod.org/

Engine samples are here: http://www.sonory.org/services-game.html

sadly, not engine sounds, and is iPhone. I’m trying to create musical scale variation in sound samples based on the timings of gameplay, without affecting the length/speed of samples.