Max Did It
Coding
,Thu
1 Comment
Tagged

Generate Procedural Motor Sounds in Flash

When developing a racing game like Rubberband Racing, you will need decent motor sounds. Driving a silent car just feels weird (Maybe it won't 50 years from now?).

If I had a loop of a car engine, I could then change the volume and the pitch of the sound dynamically depending on the velocity of the car.

The MP3 Gap Problem

My problem was that usually, you can't make clean loops and save them as MP3 files. Doing so will always introduce gaps into the audio file that will prevent it from repeating seamlessly.

If you are using Adobe's Flash Authoring Software to save your MP3s in a SWF file, then you will be able to loop them, as the program uses a trick to avoid the gap introduced by the compression.

However, I am not using Adobe Flash and I am loading the sounds as single files during runtime, so I didn't have that option.

Instead, I decided create seamlessly looping engine audio by creating it procedurally during runtime.

Read more...