# Import audio file with url

**URL:** <https://phaser.discourse.group/t/import-audio-file-with-url/4324>\
**Category:** Phaser 3\
**Created:** [November 21, 2019, 6:19am UTC](https://phaser.discourse.group/t/import-audio-file-with-url/4324 "2019-11-21T06:19:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MTGPROD](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/mtgprod/32/2343_2.png) [@MTGPROD](https://phaser.discourse.group/u/MTGPROD)\
**Post date:** [November 21, 2019, 6:19am UTC](https://phaser.discourse.group/t/import-audio-file-with-url/4324/1 "2019-11-21T06:19:33Z")

</div>

```javascript
function preload() {
this.load.audio("mainTheme", "glitch.com asset")
} 

function create() {
this.sound.play("mainTheme")
} 

```

Idk why that don’t work

---

<div class="post-metadata">

**Author:** ![paul](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/paul/32/22_2.png) [@paul](https://phaser.discourse.group/u/paul)\
**Post date:** [November 22, 2019, 1:19am UTC](https://phaser.discourse.group/t/import-audio-file-with-url/4324/2 "2019-11-22T01:19:18Z")

</div>

You need to load the audio, then add it to the scene, then play it. Check the demos out - they are great resources:

[http://labs.phaser.io/edit.html?src=src\audio\Web%20Audio\play%20audio%20file.js](http://labs.phaser.io/edit.html?src=src%5Caudio%5CWeb%20Audio%5Cplay%20audio%20file.js)
