# AudioSource not playing

**URL:** https://discussions.unity.com/t/audiosource-not-playing/112067
**Category:** Questions & Answers
**Created:** [July 28, 2014, 1:59am UTC](https://discussions.unity.com/t/audiosource-not-playing/112067 "2014-07-28T01:59:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![brazorf](https://avatars.discourse-cdn.com/v4/letter/b/f14d63/32.png) [@brazorf](https://discussions.unity.com/u/brazorf)
#### Post date: [July 28, 2014, 1:59am UTC](https://discussions.unity.com/t/audiosource-not-playing/112067/1 "2014-07-28T01:59:00Z")

</div>

The scene is like this

```
First Person Controller
|
|--- AudioSource: footsteps
|--- Graphics
|--- MainCamera
    |
    |--- AudioListener
|--- SoundAmbient
    |--- AudioSource: forest ambience

```

The footsteps audio source is triggered in the FPSInputController script, so that i can play sound when the camera is moving and shut it down when camera is idle.

SoundAmbient audio source is not working instead. The clip is assigned in the editor and it’s working in the preview window. Ive tried

- flagging “Play On Awake” in the editor
- flagging “Loop” in the editor
- removing any editor flag and adding this code in the FPSInputController Awake():

* * *

```
Debug.Log(GameObject.Find("SoundAmbient").audio.clip);

// Prints the clip name

var ambient : GameObject = GameObject.Find("SoundAmbient");

if (!ambient.audio.isPlaying) {
    ambient.audio.Play();
}

Debug.Log(ambient.audio.isPlaying);

// Prints true

```

Anyway, i can’t hear any audio from this source. Why?

Edit: i’m sorry, for some reason code won’t format properly.

---

<div class="post-metadata">

### Author: ![VIPINSIRWANI](https://avatars.discourse-cdn.com/v4/letter/v/45deac/32.png) [@VIPINSIRWANI](https://discussions.unity.com/u/VIPINSIRWANI)
#### Post date: [July 28, 2014, 7:03am UTC](https://discussions.unity.com/t/audiosource-not-playing/112067/2 "2014-07-28T07:03:15Z")

</div>

public class Test : MonoBehaviour {  
public AudioSource source;  
public AudioClip background;  
// Use this for initialization  
void Start () {  
source.clip = background;  
source.Play();  
//For Play One time  
source.PlayOneShot(background);

```
	}
}

```
