# Phaser: Playing sounds

> Learn how to play sounds in Phaser by preloading an audio file with this.load.audio, adding it with this.sound.add, and calling play when you need it.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2021-04-21 | Topics: [Phaser](https://flaviocopes.com/tags/phaser/) | Canonical: https://flaviocopes.com/phaser-sounds/

> This post is part of a Phaser series. [Click here](https://flaviocopes.com/phaser-setup/) to see the first post of the series.

Similar to displaying images, Before you can play an audio file, you must preload it and assign it to a label:

```js
function preload() {
  this.load.audio('sound', 'sound.mp3')
}
```

For images we used `this.load.image()`, here we use `this.load.audio()`.

Once this is done, we can use the sound into our create() or update() functions:

```js
this.sound.add('sound')
```

This will get you back an object. It's important to assign it to a variable:

```js
const sound = this.sound.add('sound')
```

Because later, when we want, we'll call the `play()` method on it:

```js
sound.play()
```

You can combine this with mouse events, for example, to play a sound when an item is clicked or hovered.
