Sound on collision with rigidbody and rigidbody

I'm attempting to play a sound when two rigidbody collide, a ball hitting a cube. Do I attach the sound script to the ball? Do I attach the sound file to the ball too? and this is my code. I copied it from the forums and can't seem to get it working. Thanks for your help.

var body = other.rigidbody;
var thump: AudioClip;

function OnCollisionEnter(collision : Collision) {

audio.Play(thump);

}

That script is really incomplete. "audio" isn't defined anywhere, for starters.

If you want something to play on collision, attach an AudioSource to the object you want to make the sound. Load a sound clip into the audio source (all with the Inspector, no code yet). Then, attach something like this script to the same Game Object that you have your Audio Source attached to:

// C#
public class CollisionAudioPlayer : MonoBehaviour
{
     AudioSource asrc;

     void Start()
     {
          asrc = GetComponent(typeof(AudioSource)) as AudioSource;
     }

     void OnCollisionEnter(Collision other)
     {
          if(asrc != null)
          {
               asrc.Play();
          }
     }
}

Here's what I did and it worked. I attached the sound to the GO like you suggested, then out of the OnCollisionEnter documentation I used this,

function OnCollisionEnter(collision : Collision) {
      // Play a sound based on size of impact.
      if (collision.relativeVelocity.magnitude > 0)
      audio.Play();
   }