Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im trying to create a car game in c sharp! Im now trying to figure out a way to get some sounds into the game! For example, the acceleration sound of the car.

I recently tried to add a 5 second-sound of a real car accelerating, but I don't think its the right way to do it. Because then i have to start from the beginning all the time of the clip when i accelerate.

Is there maybe some way to work with frequencies? To send a frequency to the speakers and then just increase it when I accelerate (And to make it sound like a car)

I've heard about PWM, could that be something?


share|improve this question
short loops should work – Gustavo Maciel Jan 26 '12 at 20:41
Related:… – Noctrine Jan 26 '12 at 20:42
Don't forget Doppler! – Byte56 Jan 27 '12 at 0:38
Of course Doppler only applies to other cars or if viewing the race from a fixed location. – Byte56 Jan 27 '12 at 0:46

This is not a simple task, most decent solutions involve writing DSP code, multiple channels and custom samples as seen in some of the thread @Noctrine linked.

If you're unfamiliar with audio programming the most simple suggestion I can make is that you try taking 2-3 channels and mixing them based on engine speed.

Channel 1..3 containing low, medium and high frequency loops and percentage of each channel playing based on how close the engine speed is to the sample.

Once that's working you can tweak that based on heavy acceleration or rapid braking.

The advantage to DSP coded solutions is that all this work is handled algorithmically with frequency shifting and filters and more dynamic effects are possible.

share|improve this answer
+1 The FMOD car engine examples out there illustrate this really well: – michael.bartnett Jan 27 '12 at 3:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.