Random Footsteps with variable pitch and volume

Ive seen some scripts to make random footsteps and also scripts to change the pitch and volume of an audio source, is there a way of combining them together so not only does the audio clip change but the pitch and volume of that audio clip change as well. the scripts are shown below

this is the random audio source script

var audioSources : AudioClip[];

function Start ()
    audioSources = new AudioClip[5];

function OnCollisionEnter(collision : Collision) //or whatever you have now
    //when you get to the part where you want to play the sound...
    var nextClip = audioSources[Random.Range(0, audioSources.Length)];
    audio.clip = nextClip;

this is the change pitch/volume script

var baseFootAudioVolume = 1.0;
var soundEffectPitchRandomness = 0.05;

function OnTriggerEnter (other : Collider) {
    var collisionParticleEffect : CollisionParticleEffect = other.GetComponent(CollisionParticleEffect);

    if (collisionParticleEffect) {
        Instantiate(collisionParticleEffect.effect, transform.position, transform.rotation);

    var collisionSoundEffect : CollisionSoundEffect = other.GetComponent(CollisionSoundEffect);

    if (collisionSoundEffect) {
        audio.clip = collisionSoundEffect.audioClip;
        audio.volume = collisionSoundEffect.volumeModifier * baseFootAudioVolume;
        audio.pitch = Random.Range(1.0 - soundEffectPitchRandomness, 1.0 + soundEffectPitchRandomness);

function Reset() {
    rigidbody.isKinematic = true;
    collider.isTrigger = true;

@script RequireComponent(AudioSource, SphereCollider, Rigidbody)


Yes, it can all easily be done.

In essence, you want to take the part of the second script that assign a random pitch and volume, and apply it in the first script right before the sound is to be played.

If you have any trouble doing that, then I'd recommend posting whatever specific questions you have about the process (either as a comment or by editing your post here, or as a new question either here or on the forums), and someone should be able to help.