# Loading Audio

**URL:** <https://phaser.discourse.group/t/loading-audio/1306>\
**Category:** Phaser 3\
**Created:** [February 19, 2019, 6:55pm UTC](https://phaser.discourse.group/t/loading-audio/1306 "2019-02-19T18:55:14Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![yannick](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/yannick/32/732_2.png) [@yannick](https://phaser.discourse.group/u/yannick)\
**Post date:** [February 19, 2019, 8:09pm UTC](https://phaser.discourse.group/t/loading-audio/1306/4 "2019-02-19T20:09:13Z")

</div>

If you load an audio file outside of `preload()`, it will not instantly be available. You have to wait for the `filecomplete` event.

```javascript
create() {
  let songLoader = this.load.audio('song', ['assets/sounds/0781.ogg'])
  songLoader.on('filecomplete', () => this.sound.add('song').play())
  songLoader.start()
}

```

Or if you want to use **async/await** :

```javascript
async create() {

  const asyncLoader = loaderPlugin => {
    return new Promise(resolve => {
      loaderPlugin.on('filecomplete', () => resolve()).on('loaderror', () => resolve())
      loaderPlugin.start()
    })
  }

  await asyncLoader(this.load.audio('song', ['assets/sounds/0781.ogg']))
  this.sound.add('song').play()
}

```

---

_[View the full topic](https://phaser.discourse.group/t/loading-audio/1306)._
