access sound clips through scripts

hello folks,

one thing id like to know is accessing audio clips through scripting. now, i dont mean where i drag over an audio clip to an object and then using something like this:

if(Input.GetButtonDown("Jump")){
      if(!audio.isPlaying){
            audio.Play();
       }
 }

what im looking to do is use code to access the sound from the folder its stored in. maybe something like this:

if(Input.GetButtonDown("Jump")){
      if(!audio.isPlaying("Audio/jumpSound01")){
            audio.Play();
       }
 }

or can someone help in accessing multiple sound from one object, using something like the first code snippet. i cant seem to find these things at all. its just for one sound, which has been useful, but need something for many more sounds for different things

thanks

also i do know about the use of sounds within the animation pane. which is cool.
but just need something where i can access the folder where things are stored to play

ok, ive re-worked it to have drag and drop. now im running into a error when using this type of code. it says:

MissingComponentException: There is no ‘AudioSource’ attached to the “objPlayer” game object, but a script is trying to access it.
You probably need to add a AudioSource to the game object “objPlayer”. Or your script needs to check if the component is attached before using it.
objPlayer.Update () (at Assets/Scripts/objPlayer.cs:63)

public AudioClip jumpSound;

if(!audio.isPlaying){
   audio.clip = jumpSound;
   audio.Play();
 }

but what i have done is a drag and drop of the audio onto that audio.clip that i coded in. so i just then drag in what sound i need in unity for the jump control. but im running up dry. i figured that this way would be best to move ahead since i can then access and set sounds to what i need

thanks

AudioClips just store the sound.

You need to add an AudioSource component to the object and add the clip to it.

do as the error message says: attach AudioSource component on the GO.
as for the ‘many clips’ part, that you have correct

ah ha.
though i have tried

AudioSource jumpSound;

audio.clip = jumpSound;
audio.Play();

and it doesnt work. i am still a beginner at this, but cant think of what to do

thanks for your answers and help

set it to 2D sound in import setting or move close to the audio listener ( by default main camera )

aaah, got it now.

thanks for the help people