Create a car sound with frequencies

I am trying to create a car game in C #. Now I'm trying to find a way to get some sounds in the game. For example, the sound of accelerating a car.

I recently tried to add a 5 second sound of real car acceleration, but I don't think this is the right way to do this. Because then I need to start from the very beginning all the time of the clip when I accelerate.

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

I heard about PWM, maybe this is something?

+4
source share
2 answers

One way to approach this may be to mix some sounds together ...

For example, if you had a series of sounds, for example:

  • Car idle
  • The car accelerates from 1st to 2nd, transmission, etc.
  • The sound of the car with engine deceleration / deceleration
  • The sound of the car in each gear.

You could just play different sounds at different times and switch between them. Perhaps you can even do some height adjustment during playback to fit the throttle.

I'm not sure how the professionals do it (Grand Theft Auto, Grand Turismo), but this is the first thing that comes to mind.

+1
source

Source: https://habr.com/ru/post/1393244/


All Articles