Hello Everyone.
I have been trying to work out how to change the note of a sound to mimic a car engine.
I have been trying to muck around with the SetSoundInstanceRate command but it sounds all synthesised.
LoadSound(1,"EngineRevLoop.wav")
engine_start = 0
engine_rev as float
engine_rev = 0.2
do
SetSoundInstanceRate(PlaySound(1,100,0),engine_rev)
if GetRawKeyState(asc("Q")) then engine_rev = engine_rev + 0.01
if GetRawKeyState(asc("A")) then engine_rev = engine_rev - 0.01
Print( ScreenFPS() )
Print(engine_rev)
Print(minrate)
Print(maxrate)
Sync()
loop
I have an engine loop wav file 3 seconds long but I want to change the sound in the main loop according to the revs of the engine.
Doing this just plays a new sound together with the ones already playing from the previous loop.
I have also tried stopping the current sound at the start of the loop and then begin a new sound with the new rate. But this sounds jerky.
I would like to know if there is a way of changing the Rate (or pitch) of the sound that is already playing.
Does anybody know how this can be achieved?
Thank you for reading.
Nick