Here's how you can do it:
You turn off all the sounds except the engine, duh. 😃
And then, you drive with the same rpms and the same speed, you can do this easily with a trainer.
You can record the sound with some kind of a recording program. (i use Media Audio Capture)