Engine sounds in racing computer games

Hi
Always wanted to know, how these fancy engine sounds come into being.
Is it generated on the fly? If so, how do all these little quirks appear there (like intercooler sound)? Or is it pre-recorded, and if so, how does its pitch changes?
Thanks
Comments