by Spike » Sun Oct 02, 2011 2:16 am
void(entity e, float chan, string samp, float vol, float atten, float speedpct) soundpitch = #8;
identical to existing sound builtin. using random(80,120) or so gives a reasonable range to stop sounds from being quite so monotonous. and because its the same builtin number, its generally safe to call even if the engine doesn't support the extension, you'll just loose any randomised pitches, so its great for sound effects.
Works in FTE, and from what I hear also DP now, though you'll need a fairly recent build.
specifically, the added argument is a speed percentage. passing a value of 50 will make the sound play at half the speed and thus give it a lower pitch. exercise caution when using it for voice samples due to the duration changes.
Disclaimer: old versions of DP will explode due to not expecting the extra arg, no other engine will.
.